24 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
25 &gUplReadyToPayloadPpiGuid,
57 (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
58 &gEfiEndOfPeiSignalPpiGuid,
82 OUT UINT64 *ImageSizeArg OPTIONAL,
84 OUT UINT32 *AuthenticationState
93 UINT16 ExtraDataIndex;
97 UINT32 ExtraDataCount;
109 if (EFI_ERROR (Status)) {
113 ZeroMem (&Context,
sizeof (Context));
115 }
while (EFI_ERROR (Status));
119 &gUniversalPayloadBaseGuid,
127 "Payload File Size: 0x%08X, Mem Size: 0x%08x, Reload: %d\n",
138 for (Index = 0; Index < Context.ShNum; Index++) {
140 if (EFI_ERROR (Status)) {
144 DEBUG ((DEBUG_INFO,
"Payload Section[%d]: %a\n", Index, SectionName));
145 if (
AsciiStrCmp (SectionName, UNIVERSAL_PAYLOAD_INFO_SEC_NAME) == 0) {
147 }
else if (
AsciiStrnCmp (SectionName, UNIVERSAL_PAYLOAD_EXTRA_SEC_NAME_PREFIX, UNIVERSAL_PAYLOAD_EXTRA_SEC_NAME_PREFIX_LENGTH) == 0) {
149 if (!EFI_ERROR (Status)) {
160 &gUniversalPayloadExtraDataGuid,
163 ExtraData->Count = ExtraDataCount;
164 ExtraData->Header.Revision = UNIVERSAL_PAYLOAD_EXTRA_DATA_REVISION;
165 ExtraData->Header.Length = (UINT16)Length;
166 if (ExtraDataCount != 0) {
167 for (ExtraDataIndex = 0, Index = 0; Index < Context.ShNum; Index++) {
169 if (EFI_ERROR (Status)) {
173 if (
AsciiStrnCmp (SectionName, UNIVERSAL_PAYLOAD_EXTRA_SEC_NAME_PREFIX, UNIVERSAL_PAYLOAD_EXTRA_SEC_NAME_PREFIX_LENGTH) == 0) {
175 if (!EFI_ERROR (Status)) {
176 ASSERT (ExtraDataIndex < ExtraDataCount);
178 ExtraData->Entry[ExtraDataIndex].Identifier,
179 sizeof (ExtraData->Entry[ExtraDataIndex].Identifier),
180 SectionName + UNIVERSAL_PAYLOAD_EXTRA_SEC_NAME_PREFIX_LENGTH
182 ExtraData->Entry[ExtraDataIndex].Base = (
UINTN)(Context.
FileBase + Offset);
183 ExtraData->Entry[ExtraDataIndex].Size = Size;
200 if (!EFI_ERROR (Status)) {
219 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
220 &gEfiPeiLoadFilePpiGuid,
VOID *EFIAPI BuildGuidHob(IN CONST EFI_GUID *Guid, IN UINTN DataLength)
INTN EFIAPI AsciiStrCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
INTN EFIAPI AsciiStrnCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString, IN UINTN Length)
RETURN_STATUS EFIAPI AsciiStrCpyS(OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS EFIAPI LoadElfImage(IN ELF_IMAGE_CONTEXT *ElfCt)
EFI_STATUS EFIAPI GetElfSectionName(IN ELF_IMAGE_CONTEXT *ElfCt, IN UINT32 SectionIndex, OUT CHAR8 **SectionName)
EFI_STATUS EFIAPI GetElfSectionPos(IN ELF_IMAGE_CONTEXT *ElfCt, IN UINT32 Index, OUT UINTN *Offset, OUT UINTN *Size)
EFI_STATUS EFIAPI ParseElfImage(IN VOID *ImageBase, OUT ELF_IMAGE_CONTEXT *ElfCt)
EFI_STATUS EFIAPI PeiServicesNotifyPpi(IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList)
EFI_STATUS EFIAPI PeiServicesInstallPpi(IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
EFI_STATUS EFIAPI PeiLoadFileLoadPayload(IN CONST EFI_PEI_LOAD_FILE_PPI *This, IN EFI_PEI_FILE_HANDLE FileHandle, OUT EFI_PHYSICAL_ADDRESS *ImageAddressArg OPTIONAL, OUT UINT64 *ImageSizeArg OPTIONAL, OUT EFI_PHYSICAL_ADDRESS *EntryPoint, OUT UINT32 *AuthenticationState)
EFI_STATUS EFIAPI EndOfPeiPpiNotifyCallback(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
EFI_STATUS EFIAPI InitializePayloadLoaderPeim(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
EFI_STATUS EFIAPI PeiServicesFfsFindSectionData3(IN EFI_SECTION_TYPE SectionType, IN UINTN SectionInstance, IN EFI_PEI_FILE_HANDLE FileHandle, OUT VOID **SectionData, OUT UINT32 *AuthenticationStatus)
VOID * EFI_PEI_FILE_HANDLE
VOID *EFIAPI AllocatePages(IN UINTN Pages)
UINT64 EFI_PHYSICAL_ADDRESS
#define EFI_SIZE_TO_PAGES(Size)
UINTN FileSize
The size including sections that don't require loading.
UINT8 * ImageAddress
The destination memory address set by caller.
UINTN EntryPoint
Return the actual entry point after LoadElfImage().
UINT8 * PreferredImageAddress
The preferred image to be loaded. No relocation is needed if loaded to this address.
UINTN ImageSize
The memory size for loading and execution.
UINT8 * FileBase
The source location in memory.
BOOLEAN ReloadRequired
The image needs a new memory location for running.