vendorcode/intel/edk2/edk2-stable202111: Use fixed size struct elements

Fix the FSP headers and replace void pointers by fixed sized integers
depending on the used mode to compile the FSP.
Change request here:https://github.com/intel/FSP/issues/59

This is necessary to run on x86_64, as pointers have different size.
Add preprocessor error to warn that x86_64 FSP isn't supported by the
current code.

BUG=b:200113959
TEST=Verified on Meteor Lake platform, without any compilation error

Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: I1f33db43f7932cf6d165d0c70a0e2922dad00a09
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62847
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anil Kumar K <anil.kumar.k@intel.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Subrata Banik 2022-03-16 11:14:43 +05:30 committed by Felix Held
parent 79993d8be7
commit 2bf9599cf1
1 changed files with 13 additions and 3 deletions

View File

@ -128,6 +128,7 @@ typedef struct {
UINT8 Reserved1[20]; UINT8 Reserved1[20];
} FSPT_ARCH_UPD; } FSPT_ARCH_UPD;
#if CONFIG(PLATFORM_USES_FSP2_X86_32)
/// ///
/// FSPM_ARCH_UPD Configuration. /// FSPM_ARCH_UPD Configuration.
/// ///
@ -141,12 +142,16 @@ typedef struct {
/// Pointer to the non-volatile storage (NVS) data buffer. /// Pointer to the non-volatile storage (NVS) data buffer.
/// If it is NULL it indicates the NVS data is not available. /// If it is NULL it indicates the NVS data is not available.
/// ///
VOID *NvsBufferPtr; /// Note: This ought to be VOID*, but that won't allow calling this binary on x86_64.
///
UINT32 NvsBufferPtr;
/// ///
/// Pointer to the temporary stack base address to be /// Pointer to the temporary stack base address to be
/// consumed inside FspMemoryInit() API. /// consumed inside FspMemoryInit() API.
/// ///
VOID *StackBase; /// Note: This ought to be VOID*, but that won't allow calling this binary on x86_64.
///
UINT32 StackBase;
/// ///
/// Temporary stack size to be consumed inside /// Temporary stack size to be consumed inside
/// FspMemoryInit() API. /// FspMemoryInit() API.
@ -165,9 +170,14 @@ typedef struct {
/// Optional event handler for the bootloader to be informed of events occurring during FSP execution. /// Optional event handler for the bootloader to be informed of events occurring during FSP execution.
/// This value is only valid if Revision is >= 2. /// This value is only valid if Revision is >= 2.
/// ///
FSP_EVENT_HANDLER *FspEventHandler; /// Note: This ought to be FSP_EVENT_HANDLER*, but that won't allow calling this binary on x86_64.
///
UINT32 FspEventHandler;
UINT8 Reserved1[4]; UINT8 Reserved1[4];
} FSPM_ARCH_UPD; } FSPM_ARCH_UPD;
#else
#error You need to implement this struct for x86_64 FSP
#endif
typedef struct { typedef struct {
/// ///