libpayload/arch/x86: Update API handling of CBTABLE handoff

The payload API of coreboot described in
https://www.coreboot.org/Payload_API does not reflect the current
handoff mechanism to hand the coreboot tables off. Therefore the
arguments supplied by coreboot (cbtable) will currently never be parsed
correctly and libpayload has to search for the coreboot tables by
iterating through memory.

This patch removes the old payload API implementation and just takes the
coreboot table pointer from the first argument on the stack.

Tested: started prodrive/atlas with coreinfo payload

Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Change-Id: I51fb0cfc81043cbfe3fc9c8ea0776add2d6a42b2
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74965
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Maximilian Brune
2023-05-05 15:10:24 +02:00
committed by Felix Held
parent 00d9107e02
commit 9d475bf6de
4 changed files with 12 additions and 29 deletions

View File

@@ -55,11 +55,6 @@ mb_header:
.long _end
.long _init
#define CB_MAGIC_VALUE 0x12345678
#define CB_MAGIC 0x04
#define CB_ARGV 0x08
#define CB_ARGC 0x10
/*
* This function saves off the previous stack and switches us to our
* own execution environment.
@@ -72,18 +67,10 @@ _init:
movl %eax, loader_eax
movl %ebx, loader_ebx
/* Copy argv[] and argc as demanded by the Payload API,
* see https://www.coreboot.org/Payload_API and exec.S.
*/
cmpl $CB_MAGIC_VALUE, CB_MAGIC(%esp)
jne 1f
/* save pointer to coreboot tables */
movl 4(%esp), %eax
movl %eax, cb_header_ptr
movl CB_ARGV(%esp), %eax
movl %eax, main_argv
movl CB_ARGC(%esp), %eax
movl %eax, main_argc
1:
/* Store current stack pointer and set up new stack. */
movl %esp, %eax
movl $_stack, %esp