6.3 Prepare for Data PEI Foundation
Upon completion, SEC will call the PEI Foundation entry point and transfer control to it.
The PEI foundation Entry Point is defined as,
typedef
VOID
EFIAPI
(*EFI_PEI_CORE_ENTRY_POINT)(
IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList );
6.3.1 EFI_SEC_PEI_HAND_OFF * SecCoreData
SEC conveys the following handoff information to the PEI Foundation, State of the platform.
Location and size of the Boot Firmware Volume (BFV).
Location and size of the temporary RAM.
Location and size of the stack.
The format is defined as the EFI_SEC_PEI_HAND_OFF
structure.
An example of, the temporary memory layout from Nt32Pkg is shown below:
|-----------| <---- TemporaryRamBase + TemporaryRamSize
| Heap |
| |
|-----------| <---- StackBase / PeiTemporaryMemoryBase
| |
| Stack |
|-----------| <---- TemporaryRamBase
Figure 3 Temporary Memory Layout
The EFI_SEC_PEI_HAND_OFF
data structure is populated as follows:
SecCoreData->DataSize = sizeof (EFI_SEC_PEI_HAND_OFF);
SecCoreData->BootFirmwareVolumeBase = (VOID *)BootFirmwareVolumeBase;
SecCoreData->BootFirmwareVolumeSize = PcdWinNtFirmwareFdSize;
SecCoreData->TemporaryRamBase = (VOID *)(UINTN)LargestRegion;
SecCoreData->TemporaryRamSize = STACK_SIZE;
SecCoreData->StackBase = SecCoreData->TemporaryRamBase;
SecCoreData->StackSize = PeiStackSize;
SecCoreData->PeiTemporaryRamBase = (VOID *)((UINTN)
SecCoreData->TemporaryRamBase + PeiStackSize);
SecCoreData->PeiTemporaryRamSize = STACK_SIZE - PeiStackSize;
6.3.2 EFI_PEI_PPI_DESCRIPTOR *PpiList
Besides the EFI_SEC_PEI_HAND_OFF
data structure, SEC may transfer one
additional PpiList
to the PEIM Foundation. For example, PpiList
may include
TEMPORARY_RAM_SUPPORT_PPI
and SEC_PLATFORM_INFORMAITON_PPI
.
TEMPORARY_RAM_SUPPORT_PPI
This service may be published by the SEC as part of the SEC-to-PEI handoff. If so, it moves the Temporary RAM contents into Permanent RAM.
SEC_PLATFORM_INFORMAITON_PPI
This service abstracts platform-specific information. It is necessary to convey this information to the PEI Foundation so that it can locate the PEIM dispatch order. In addition, it contains the maximum stack capabilities of this platform.