From b7cc68ae6aa5d3effec7606ea1020adfe69384e6 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Sat, 19 Oct 2019 22:56:44 +0200 Subject: arch/x86/boot.c: Pass arguments when running programs Payloads can use coreboot tables passed on via arguments instead of via a pointer in lower memory. Stages can make use of the argument to pass on information. Change-Id: Ie0f44e9e1992221e02c49d0492cdd2a3d9013560 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/36143 Reviewed-by: Nico Huber Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/arch/x86/boot.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/arch') diff --git a/src/arch/x86/boot.c b/src/arch/x86/boot.c index 5f60f1394a..ada49d0368 100644 --- a/src/arch/x86/boot.c +++ b/src/arch/x86/boot.c @@ -30,13 +30,12 @@ int payload_arch_usable_ram_quirk(uint64_t start, uint64_t size) void arch_prog_run(struct prog *prog) { - __asm__ volatile ( #ifdef __x86_64__ - "jmp *%%rdi\n" + void (*doit)(void *arg); #else - "jmp *%%edi\n" + /* Ensure the argument is pushed on the stack. */ + asmlinkage void (*doit)(void *arg); #endif - - :: "D"(prog_entry(prog)) - ); + doit = prog_entry(prog); + doit(prog_entry_arg(prog)); } -- cgit v1.2.3