TianoCore EDK2 master
|
#include <PiPei.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
#include <Library/PeCoffLib.h>
#include <Library/HobLib.h>
#include <Library/PcdLib.h>
#include <Guid/MemoryAllocationHob.h>
#include <Library/IoLib.h>
#include <Library/BlParseLib.h>
#include <Library/PlatformSupportLib.h>
#include <Library/CpuLib.h>
#include <IndustryStandard/Acpi.h>
#include <IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h>
#include <Guid/SerialPortInfoGuid.h>
#include <Guid/MemoryMapInfoGuid.h>
#include <Guid/AcpiBoardInfoGuid.h>
#include <Guid/GraphicsInfoHob.h>
#include <UniversalPayload/SmbiosTable.h>
#include <UniversalPayload/AcpiTable.h>
#include <UniversalPayload/UniversalPayload.h>
#include <UniversalPayload/ExtraData.h>
#include <UniversalPayload/SerialPortInfo.h>
#include <UniversalPayload/DeviceTree.h>
#include <Guid/PcdDataBaseSignatureGuid.h>
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_INFO * | BuildHobFromAcpi (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) |
Copyright (c) 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UefiPayloadEntry.h.
#define E820_ACPI 3 |
Definition at line 48 of file UefiPayloadEntry.h.
#define E820_DISABLED 6 |
Definition at line 51 of file UefiPayloadEntry.h.
#define E820_NVS 4 |
Definition at line 49 of file UefiPayloadEntry.h.
#define E820_PMEM 7 |
Definition at line 52 of file UefiPayloadEntry.h.
#define E820_RAM 1 |
Definition at line 46 of file UefiPayloadEntry.h.
#define E820_RESERVED 2 |
Definition at line 47 of file UefiPayloadEntry.h.
#define E820_UNDEFINED 8 |
Definition at line 53 of file UefiPayloadEntry.h.
#define E820_UNUSABLE 5 |
Definition at line 50 of file UefiPayloadEntry.h.
#define GET_OCCUPIED_SIZE | ( | ActualSize, | |
Alignment | |||
) | ((ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) & ((Alignment) - 1))) |
Definition at line 43 of file UefiPayloadEntry.h.
#define LEGACY_8259_MASK_REGISTER_MASTER 0x21 |
Definition at line 41 of file UefiPayloadEntry.h.
#define LEGACY_8259_MASK_REGISTER_SLAVE 0xA1 |
Definition at line 42 of file UefiPayloadEntry.h.
ACPI_BOARD_INFO * BuildHobFromAcpi | ( | IN UINT64 | AcpiTableBase | ) |
Build ACPI board info HOB using infomation from ACPI table
AcpiTableBase | ACPI table start address in memory |
A | pointer to ACPI board HOB ACPI_BOARD_INFO. Null if build HOB failure. |
Definition at line 139 of file AcpiTable.c.
Add a new HOB to the HOB List.
HobType | Type of the new HOB. |
HobLength | Length of the new HOB to allocate. |
This service enables PEIMs to create various types of HOBs.
Type | The type of HOB to be installed. |
Length | The length of the HOB to be added. |
!NULL | The HOB was successfully created. |
NULL | There is no additional space for HOB creation. |
It will Parse FDT -custom node based on information.
[in] | FdtBase | The starting memory address of FdtBase |
[in] | HostList | The starting memory address of New Hob list. |
It will Parse FDT -custom node based on information from bootloaders.
[in] | FdtBase | The starting memory address of FdtBase |
[in] | HobList | The starting memory address of New Hob list. |
It will Parse FDT -custom node based on information from bootloaders.
[in] | FdtBase | The starting memory address of FdtBase. |
[in] | HobList | The starting memory address of New Hob list. |
HobList | The base address of Hoblist. |
Definition at line 120 of file CustomFdtNodeParserLib.c.
UINT64 EFIAPI FdtNodeParser | ( | IN VOID * | FdtBase | ) |
It will Parse FDT -node based on information.
[in] | FdtBase | The starting memory address of FdtBase |
HobList | The base address of Hoblist. |
It will Parse FDT -node based on information from bootloaders.
[in] | FdtBase | The starting memory address of FdtBase |
HobList | The base address of Hoblist. |
Definition at line 1002 of file FdtParserLib.c.
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.
FileHeader | A pointer to the file header that contains the set of sections to be searched. |
SearchType | The value of the section type to search. |
SectionData | A pointer to the discovered section, if successful. |
EFI_SUCCESS | The section was found. |
EFI_NOT_FOUND | The section was not found. |
This function searchs a given section type within a valid FFS file.
FileHeader | A pointer to the file header that contains the set of sections to be searched. |
SectionType | The value of the section type to search. |
SectionData | A pointer to the discovered section, if successful. |
EFI_SUCCESS | The section was found. |
EFI_NOT_FOUND | The section was not found. |
Definition at line 201 of file LoadDxeCore.c.
EFI_STATUS EFIAPI FitUplEntryPoint | ( | IN UINTN | BootloaderParameter | ) |
Entry point to the C language phase of UEFI payload.
[in] | FdtPrt | The starting address of FDT . |
It | will not return if SUCCESS, and return error when passing bootloader parameter. |
Entry point to the C language phase of UEFI payload.
[in] | BootloaderParameter | The starting address of FDT . |
It | will not return if SUCCESS, and return error when passing bootloader parameter. |
Definition at line 495 of file FitUniversalPayloadEntry.c.
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.
[in] | DxeFv | The FV where to find the Universal PCD database. |
EFI_SUCCESS | If it completed successfully. |
other | Failed to fix up. |
Definition at line 165 of file FitUniversalPayloadEntry.c.
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
FvHeader | A pointer to firmware volume header that contains the set of files to be searched. |
FileType | File type to be searched. |
Guid | Will ignore if it is NULL. |
FileHeader | A pointer to the discovered file, if successful. |
EFI_SUCCESS | Successfully found FileType |
EFI_NOT_FOUND | File type can't be found. |
Definition at line 131 of file LoadDxeCore.c.
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.
DxeCoreEntryPoint | The entry point of DxeCore. |
HobList | The 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.
DxeCoreEntryPoint | The entry point of DxeCore. |
HobList | The start of HobList passed to DxeCore. |
Definition at line 26 of file DxeHandoff.c.
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.
[in] | EfiMemoryBottom | Total memory start address |
[in] | EfiMemoryTop | Total memory end address. |
[in] | EfiFreeMemoryBottom | Free memory start address |
[in] | EfiFreeMemoryTop | Free memory end address. |
EFI_STATUS LoadDxeCore | ( | OUT PHYSICAL_ADDRESS * | DxeCoreEntryPoint | ) |
Find DXE core from FV and build DXE core HOBs.
[out] | DxeCoreEntryPoint | DXE core entry point |
EFI_SUCCESS | If it completed successfully. |
EFI_NOT_FOUND | If it failed to load DXE FV. |
Definition at line 259 of file LoadDxeCore.c.
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.
Pages | The number of 4 KB pages to allocate. |
MemoryType | The Memorytype |
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.
Pages | The number of 4 KB pages to allocate. |
MemoryType | The MemoryType |
Definition at line 28 of file MemoryAllocation.c.
EFI_STATUS UniversalLoadDxeCore | ( | IN EFI_FIRMWARE_VOLUME_HEADER * | DxeFv, |
OUT PHYSICAL_ADDRESS * | DxeCoreEntryPoint | ||
) |
Find DXE core from FV and build DXE core HOBs.
[in] | DxeFv | The FV where to find the DXE core. |
[out] | DxeCoreEntryPoint | DXE core entry point |
EFI_SUCCESS | If it completed successfully. |
EFI_NOT_FOUND | If it failed to load DXE FV. |
Definition at line 327 of file LoadDxeCore.c.
VOID EFIAPI UpdateStackHob | ( | IN EFI_PHYSICAL_ADDRESS | BaseAddress, |
IN UINT64 | Length | ||
) |
Update the Stack Hob if the stack has been moved
BaseAddress | The 64 bit physical address of the Stack. |
Length | The 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.
BaseAddress | The lower address of stack used by DxeCore. |
Length | The length of stack used by DxeCore. |
EFI_STATUS EFIAPI UplEntryPoint | ( | IN UINTN | BootloaderParameter | ) |
Entry point to the C language phase of UEFI payload.
[in] | BootloaderParameter | The starting address of bootloader parameter block. |
It | will not return if SUCCESS, and return error when passing bootloader parameter. |