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 <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36143
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Arthur Heymans 2019-10-19 22:56:44 +02:00 committed by Patrick Georgi
parent 9b8d28f013
commit b7cc68ae6a
1 changed files with 5 additions and 6 deletions

View File

@ -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));
}