TianoCore EDK2 master
Loading...
Searching...
No Matches
UefiPayloadEntry.h File Reference

Go to the source code of this file.

Macros

#define LEGACY_8259_MASK_REGISTER_MASTER   0x21
 
#define LEGACY_8259_MASK_REGISTER_SLAVE   0xA1
 
#define GET_OCCUPIED_SIZE(ActualSize, Alignment)    ((ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) & ((Alignment) - 1)))
 
#define E820_RAM   1
 
#define E820_RESERVED   2
 
#define E820_ACPI   3
 
#define E820_NVS   4
 
#define E820_UNUSABLE   5
 
#define E820_DISABLED   6
 
#define E820_PMEM   7
 
#define E820_UNDEFINED   8
 

Functions

VOID *EFIAPI CreateHob (IN UINT16 HobType, IN UINT16 HobLength)
 
VOID EFIAPI UpdateStackHob (IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
 
EFI_HOB_HANDOFF_INFO_TABLE *EFIAPI HobConstructor (IN VOID *EfiMemoryBottom, IN VOID *EfiMemoryTop, IN VOID *EfiFreeMemoryBottom, IN VOID *EfiFreeMemoryTop)
 
EFI_STATUS LoadDxeCore (OUT PHYSICAL_ADDRESS *DxeCoreEntryPoint)
 
EFI_STATUS UniversalLoadDxeCore (IN EFI_FIRMWARE_VOLUME_HEADER *DxeFv, OUT PHYSICAL_ADDRESS *DxeCoreEntryPoint)
 
UINT64 EFIAPI FdtNodeParser (IN VOID *FdtBase)
 
UINTN EFIAPI CustomFdtNodeParser (IN VOID *FdtBase, IN VOID *HostList)
 
VOID HandOffToDxeCore (IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint, IN EFI_PEI_HOB_POINTERS HobList)
 
EFI_STATUS FixUpPcdDatabase (IN EFI_FIRMWARE_VOLUME_HEADER *DxeFv)
 
EFI_STATUS FileFindSection (IN EFI_FFS_FILE_HEADER *FileHeader, IN EFI_SECTION_TYPE SectionType, OUT VOID **SectionData)
 
EFI_STATUS FvFindFileByTypeGuid (IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader, IN EFI_FV_FILETYPE FileType, IN EFI_GUID *Guid OPTIONAL, OUT EFI_FFS_FILE_HEADER **FileHeader)
 
ACPI_BOARD_INFOBuildHobFromAcpi (IN UINT64 AcpiTableBase)
 
VOID *EFIAPI PayloadAllocatePages (IN UINTN Pages, IN EFI_MEMORY_TYPE MemoryType)
 
EFI_STATUS EFIAPI FitUplEntryPoint (IN UINTN BootloaderParameter)
 
EFI_STATUS EFIAPI UplEntryPoint (IN UINTN BootloaderParameter)
 

Detailed Description

Copyright (c) 2021, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file UefiPayloadEntry.h.

Macro Definition Documentation

◆ E820_ACPI

#define E820_ACPI   3

Definition at line 48 of file UefiPayloadEntry.h.

◆ E820_DISABLED

#define E820_DISABLED   6

Definition at line 51 of file UefiPayloadEntry.h.

◆ E820_NVS

#define E820_NVS   4

Definition at line 49 of file UefiPayloadEntry.h.

◆ E820_PMEM

#define E820_PMEM   7

Definition at line 52 of file UefiPayloadEntry.h.

◆ E820_RAM

#define E820_RAM   1

Definition at line 46 of file UefiPayloadEntry.h.

◆ E820_RESERVED

#define E820_RESERVED   2

Definition at line 47 of file UefiPayloadEntry.h.

◆ E820_UNDEFINED

#define E820_UNDEFINED   8

Definition at line 53 of file UefiPayloadEntry.h.

◆ E820_UNUSABLE

#define E820_UNUSABLE   5

Definition at line 50 of file UefiPayloadEntry.h.

◆ GET_OCCUPIED_SIZE

#define GET_OCCUPIED_SIZE (   ActualSize,
  Alignment 
)     ((ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) & ((Alignment) - 1)))

Definition at line 43 of file UefiPayloadEntry.h.

◆ LEGACY_8259_MASK_REGISTER_MASTER

#define LEGACY_8259_MASK_REGISTER_MASTER   0x21

Definition at line 41 of file UefiPayloadEntry.h.

◆ LEGACY_8259_MASK_REGISTER_SLAVE

#define LEGACY_8259_MASK_REGISTER_SLAVE   0xA1

Definition at line 42 of file UefiPayloadEntry.h.

Function Documentation

◆ BuildHobFromAcpi()

ACPI_BOARD_INFO * BuildHobFromAcpi ( IN UINT64  AcpiTableBase)

Build ACPI board info HOB using infomation from ACPI table

Parameters
AcpiTableBaseACPI table start address in memory
Return values
Apointer to ACPI board HOB ACPI_BOARD_INFO. Null if build HOB failure.

Definition at line 139 of file AcpiTable.c.

◆ CreateHob()

VOID *EFIAPI CreateHob ( IN UINT16  HobType,
IN UINT16  HobLength 
)

Add a new HOB to the HOB List.

Parameters
HobTypeType of the new HOB.
HobLengthLength of the new HOB to allocate.
Returns
NULL if there is no space to create a hob.
The address point to the new created hob.

This service enables PEIMs to create various types of HOBs.

Parameters
TypeThe type of HOB to be installed.
LengthThe length of the HOB to be added.
Return values
!NULLThe HOB was successfully created.
NULLThere is no additional space for HOB creation.

Definition at line 101 of file Hob.c.

◆ CustomFdtNodeParser()

UINTN EFIAPI CustomFdtNodeParser ( IN VOID *  Fdt,
IN VOID *  HobList 
)

It will Parse FDT -custom node based on information.

Parameters
[in]FdtBaseThe starting memory address of FdtBase
[in]HostListThe starting memory address of New Hob list.

It will Parse FDT -custom node based on information from bootloaders.

Parameters
[in]FdtBaseThe starting memory address of FdtBase
[in]HobListThe starting memory address of New Hob list.

It will Parse FDT -custom node based on information from bootloaders.

Parameters
[in]FdtBaseThe starting memory address of FdtBase.
[in]HobListThe starting memory address of New Hob list.
Return values
HobListThe base address of Hoblist.

Definition at line 120 of file CustomFdtNodeParserLib.c.

◆ FdtNodeParser()

UINT64 EFIAPI FdtNodeParser ( IN VOID *  FdtBase)

It will Parse FDT -node based on information.

Parameters
[in]FdtBaseThe starting memory address of FdtBase
Return values
HobListThe base address of Hoblist.

It will Parse FDT -node based on information from bootloaders.

Parameters
[in]FdtBaseThe starting memory address of FdtBase
Return values
HobListThe base address of Hoblist.

Definition at line 1002 of file FdtParserLib.c.

◆ FileFindSection()

EFI_STATUS FileFindSection ( IN EFI_FFS_FILE_HEADER FileHeader,
IN EFI_SECTION_TYPE  SectionType,
OUT VOID **  SectionData 
)

This function searchs a given section type within a valid FFS file.

Parameters
FileHeaderA pointer to the file header that contains the set of sections to be searched.
SearchTypeThe value of the section type to search.
SectionDataA pointer to the discovered section, if successful.
Return values
EFI_SUCCESSThe section was found.
EFI_NOT_FOUNDThe section was not found.

This function searchs a given section type within a valid FFS file.

Parameters
FileHeaderA pointer to the file header that contains the set of sections to be searched.
SectionTypeThe value of the section type to search.
SectionDataA pointer to the discovered section, if successful.
Return values
EFI_SUCCESSThe section was found.
EFI_NOT_FOUNDThe section was not found.

Definition at line 201 of file LoadDxeCore.c.

◆ FitUplEntryPoint()

EFI_STATUS EFIAPI FitUplEntryPoint ( IN UINTN  BootloaderParameter)

Entry point to the C language phase of UEFI payload.

Parameters
[in]FdtPrtThe starting address of FDT .
Return values
Itwill not return if SUCCESS, and return error when passing bootloader parameter.

Entry point to the C language phase of UEFI payload.

Parameters
[in]BootloaderParameterThe starting address of FDT .
Return values
Itwill not return if SUCCESS, and return error when passing bootloader parameter.

Definition at line 495 of file FitUniversalPayloadEntry.c.

◆ FixUpPcdDatabase()

EFI_STATUS FixUpPcdDatabase ( IN EFI_FIRMWARE_VOLUME_HEADER DxeFv)

Some bootloader may pass a pcd database, and UPL also contain a PCD database. Dxe PCD driver has the assumption that the two PCD database can be catenated and the local token number should be successive. This function will fix up the UPL PCD database to meet that assumption.

Parameters
[in]DxeFvThe FV where to find the Universal PCD database.
Return values
EFI_SUCCESSIf it completed successfully.
otherFailed to fix up.

Definition at line 165 of file FitUniversalPayloadEntry.c.

◆ FvFindFileByTypeGuid()

EFI_STATUS FvFindFileByTypeGuid ( IN EFI_FIRMWARE_VOLUME_HEADER FvHeader,
IN EFI_FV_FILETYPE  FileType,
IN EFI_GUID *Guid  OPTIONAL,
OUT EFI_FFS_FILE_HEADER **  FileHeader 
)

This function searchs a given file type with a given Guid within a valid FV. If input Guid is NULL, will locate the first section having the given file type

Parameters
FvHeaderA pointer to firmware volume header that contains the set of files to be searched.
FileTypeFile type to be searched.
GuidWill ignore if it is NULL.
FileHeaderA pointer to the discovered file, if successful.
Return values
EFI_SUCCESSSuccessfully found FileType
EFI_NOT_FOUNDFile type can't be found.

Definition at line 131 of file LoadDxeCore.c.

◆ HandOffToDxeCore()

VOID HandOffToDxeCore ( IN EFI_PHYSICAL_ADDRESS  DxeCoreEntryPoint,
IN EFI_PEI_HOB_POINTERS  HobList 
)

Transfers control to DxeCore.

This function performs a CPU architecture specific operations to execute the entry point of DxeCore with the parameters of HobList.

Parameters
DxeCoreEntryPointThe entry point of DxeCore.
HobListThe start of HobList passed to DxeCore.

Transfers control to DxeCore.

This function performs a CPU architecture specific operations to execute the entry point of DxeCore with the parameters of HobList. It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.

Parameters
DxeCoreEntryPointThe entry point of DxeCore.
HobListThe start of HobList passed to DxeCore.

Definition at line 26 of file DxeHandoff.c.

◆ HobConstructor()

EFI_HOB_HANDOFF_INFO_TABLE *EFIAPI HobConstructor ( IN VOID *  EfiMemoryBottom,
IN VOID *  EfiMemoryTop,
IN VOID *  EfiFreeMemoryBottom,
IN VOID *  EfiFreeMemoryTop 
)

Build a Handoff Information Table HOB

This function initialize a HOB region from EfiMemoryBegin to EfiMemoryTop. And EfiFreeMemoryBottom and EfiFreeMemoryTop should be inside the HOB region.

Parameters
[in]EfiMemoryBottomTotal memory start address
[in]EfiMemoryTopTotal memory end address.
[in]EfiFreeMemoryBottomFree memory start address
[in]EfiFreeMemoryTopFree memory end address.
Returns
The pointer to the handoff HOB table.

Definition at line 54 of file Hob.c.

◆ LoadDxeCore()

EFI_STATUS LoadDxeCore ( OUT PHYSICAL_ADDRESS *  DxeCoreEntryPoint)

Find DXE core from FV and build DXE core HOBs.

Parameters
[out]DxeCoreEntryPointDXE core entry point
Return values
EFI_SUCCESSIf it completed successfully.
EFI_NOT_FOUNDIf it failed to load DXE FV.

Definition at line 259 of file LoadDxeCore.c.

◆ PayloadAllocatePages()

VOID *EFIAPI PayloadAllocatePages ( IN UINTN  Pages,
IN EFI_MEMORY_TYPE  MemoryType 
)

Allocates one or more pages .

Allocates the number of pages of MemoryType and returns a pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL is returned. If there is not enough memory availble to satisfy the request, then NULL is returned.

Parameters
PagesThe number of 4 KB pages to allocate.
MemoryTypeThe Memorytype
Returns
A pointer to the allocated buffer or NULL if allocation fails.

Allocates one or more pages of type EfiBootServicesData.

Allocates the number of pages of MemoryType and returns a pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL is returned. If there is not enough memory availble to satisfy the request, then NULL is returned.

Parameters
PagesThe number of 4 KB pages to allocate.
MemoryTypeThe MemoryType
Returns
A pointer to the allocated buffer or NULL if allocation fails.

Definition at line 28 of file MemoryAllocation.c.

◆ UniversalLoadDxeCore()

EFI_STATUS UniversalLoadDxeCore ( IN EFI_FIRMWARE_VOLUME_HEADER DxeFv,
OUT PHYSICAL_ADDRESS *  DxeCoreEntryPoint 
)

Find DXE core from FV and build DXE core HOBs.

Parameters
[in]DxeFvThe FV where to find the DXE core.
[out]DxeCoreEntryPointDXE core entry point
Return values
EFI_SUCCESSIf it completed successfully.
EFI_NOT_FOUNDIf it failed to load DXE FV.

Definition at line 327 of file LoadDxeCore.c.

◆ UpdateStackHob()

VOID EFIAPI UpdateStackHob ( IN EFI_PHYSICAL_ADDRESS  BaseAddress,
IN UINT64  Length 
)

Update the Stack Hob if the stack has been moved

Parameters
BaseAddressThe 64 bit physical address of the Stack.
LengthThe length of the stack in bytes.

Updates the Stack HOB passed to DXE phase.

This function traverses the whole HOB list and update the stack HOB to reflect the real stack that is used by DXE core.

Parameters
BaseAddressThe lower address of stack used by DxeCore.
LengthThe length of stack used by DxeCore.

Definition at line 731 of file Hob.c.

◆ UplEntryPoint()

EFI_STATUS EFIAPI UplEntryPoint ( IN UINTN  BootloaderParameter)

Entry point to the C language phase of UEFI payload.

Parameters
[in]BootloaderParameterThe starting address of bootloader parameter block.
Return values
Itwill not return if SUCCESS, and return error when passing bootloader parameter.