📄 peicore.h
字号:
VOID
ProcessNotifyList (
IN EFI_PEI_SERVICES **PeiServices
)
/*++
Routine Description:
Process the Notify List at dispatch level.
Arguments:
PeiServices - Pointer to the PEI Service Table
Returns:
--*/
;
VOID
DispatchNotify (
IN EFI_PEI_SERVICES **PeiServices,
IN UINTN NotifyType,
IN INTN InstallStartIndex,
IN INTN InstallStopIndex,
IN INTN NotifyStartIndex,
IN INTN NotifyStopIndex
)
/*++
Routine Description:
Dispatch notifications.
Arguments:
PeiServices - Pointer to the PEI Service Table
NotifyType - Type of notify to fire.
InstallStartIndex - Install Beginning index.
InstallStopIndex - Install Ending index.
NotifyStartIndex - Notify Beginning index.
NotifyStopIndex - Notify Ending index.
Returns: None
--*/
;
//
// Boot mode support functions
//
EFI_STATUS
EFIAPI
PeiGetBootMode (
IN EFI_PEI_SERVICES **PeiServices,
IN OUT EFI_BOOT_MODE *BootMode
)
/*++
Routine Description:
This service enables PEIMs to ascertain the present value of the boot mode.
Arguments:
PeiServices - The PEI core services table.
BootMode - A pointer to contain the value of the boot mode.
Returns:
EFI_SUCCESS - The boot mode was returned successfully.
EFI_INVALID_PARAMETER - BootMode is NULL.
--*/
;
EFI_STATUS
EFIAPI
PeiSetBootMode (
IN EFI_PEI_SERVICES **PeiServices,
IN EFI_BOOT_MODE BootMode
)
/*++
Routine Description:
This service enables PEIMs to update the boot mode variable.
Arguments:
PeiServices - The PEI core services table.
BootMode - The value of the boot mode to set.
Returns:
EFI_SUCCESS - The value was successfully updated
--*/
;
//
// Security support functions
//
VOID
InitializeSecurityServices (
IN EFI_PEI_SERVICES **PeiServices,
IN PEI_CORE_INSTANCE *OldCoreData
)
/*++
Routine Description:
Initialize the security services.
Arguments:
PeiServices - The PEI core services table.
OldCoreData - Pointer to the old core data.
NULL if being run in non-permament memory mode.
Returns:
None
--*/
;
EFI_STATUS
VerifyFv (
IN EFI_FIRMWARE_VOLUME_HEADER *CurrentFvAddress
)
/*++
Routine Description:
Provide a callout to the OEM FV verification service.
Arguments:
CurrentFvAddress - Pointer to the FV under investigation.
Returns:
Status - EFI_SUCCESS
--*/
;
EFI_STATUS
VerifyPeim (
IN EFI_PEI_SERVICES **PeiServices,
IN EFI_FFS_FILE_HEADER *CurrentPeimAddress
)
/*++
Routine Description:
Provide a callout to the security verification service.
Arguments:
PeiServices - The PEI core services table.
CurrentPeimAddress - Pointer to the Firmware File under investigation.
Returns:
EFI_SUCCESS - Image is OK
EFI_SECURITY_VIOLATION - Image is illegal
--*/
;
EFI_STATUS
EFIAPI
PeiGetHobList (
IN EFI_PEI_SERVICES **PeiServices,
IN OUT VOID **HobList
)
/*++
Routine Description:
Gets the pointer to the HOB List.
Arguments:
PeiServices - The PEI core services table.
HobList - Pointer to the HOB List.
Returns:
EFI_SUCCESS - Get the pointer of HOB List
EFI_NOT_AVAILABLE_YET - the HOB List is not yet published
EFI_INVALID_PARAMETER - HobList is NULL (in debug mode)
--*/
;
EFI_STATUS
EFIAPI
PeiCreateHob (
IN EFI_PEI_SERVICES **PeiServices,
IN UINT16 Type,
IN UINT16 Length,
IN OUT VOID **Hob
)
/*++
Routine Description:
Add a new HOB to the HOB List.
Arguments:
PeiServices - The PEI core services table.
Type - Type of the new HOB.
Length - Length of the new HOB to allocate.
Hob - Pointer to the new HOB.
Returns:
Status - EFI_SUCCESS
- EFI_INVALID_PARAMETER if Hob is NULL
- EFI_NOT_AVAILABLE_YET if HobList is still not available.
- EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
--*/
;
EFI_STATUS
PeiCoreBuildHobHandoffInfoTable (
IN EFI_BOOT_MODE BootMode,
IN EFI_PHYSICAL_ADDRESS MemoryBegin,
IN UINT64 MemoryLength
)
/*++
Routine Description:
Builds a Handoff Information Table HOB
Arguments:
BootMode - Current Bootmode
MemoryBegin - Start Memory Address.
MemoryLength - Length of Memory.
Returns:
EFI_SUCCESS
--*/
;
//
// FFS Fw Volume support functions
//
EFI_STATUS
EFIAPI
PeiFfsFindNextFile (
IN EFI_PEI_SERVICES **PeiServices,
IN UINT8 SearchType,
IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
IN OUT EFI_FFS_FILE_HEADER **FileHeader
)
/*++
Routine Description:
Given the input file pointer, search for the next matching file in the
FFS volume as defined by SearchType. The search starts from FileHeader inside
the Firmware Volume defined by FwVolHeader.
Arguments:
PeiServices - Pointer to the PEI Core Services Table.
SearchType - Filter to find only files of this type.
Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
FwVolHeader - Pointer to the FV header of the volume to search.
This parameter must point to a valid FFS volume.
FileHeader - Pointer to the current file from which to begin searching.
This pointer will be updated upon return to reflect the file found.
Returns:
EFI_NOT_FOUND - No files matching the search criteria were found
EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
PeiFfsFindSectionData (
IN EFI_PEI_SERVICES **PeiServices,
IN EFI_SECTION_TYPE SectionType,
IN EFI_FFS_FILE_HEADER *FfsFileHeader,
IN OUT VOID **SectionData
)
/*++
Routine Description:
Given the input file pointer, search for the next matching section in the
FFS volume.
Arguments:
PeiServices - Pointer to the PEI Core Services Table.
SearchType - Filter to find only sections of this type.
FfsFileHeader - Pointer to the current file to search.
SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
- NULL if section not found
Returns:
EFI_NOT_FOUND - No files matching the search criteria were found
EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
PeiFvFindNextVolume (
IN EFI_PEI_SERVICES **PeiServices,
IN UINTN Instance,
IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
)
/*++
Routine Description:
Return the BFV location
BugBug -- Move this to the location of this code to where the
other FV and FFS support code lives.
Also, update to use FindFV for instances #'s >= 1.
Arguments:
PeiServices - The PEI core services table.
Instance - Instance of FV to find
FwVolHeader - Pointer to contain the data to return
Returns:
Pointer to the Firmware Volume instance requested
EFI_INVALID_PARAMETER - FwVolHeader is NULL
EFI_SUCCESS - Firmware volume instance successfully found.
--*/
;
//
// Memory support functions
//
VOID
InitializeMemoryServices (
IN EFI_PEI_SERVICES **PeiServices,
IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartupDescriptor,
IN PEI_CORE_INSTANCE *OldCoreData
)
/*++
Routine Description:
Initialize the memory services.
Arguments:
PeiServices - The PEI core services table.
PeiStartupDescriptor - Information and services provided by SEC phase.
OldCoreData - Pointer to the PEI Core data.
NULL if being run in non-permament memory mode.
Returns:
None
--*/
;
EFI_STATUS
EFIAPI
PeiInstallPeiMemory (
IN EFI_PEI_SERVICES **PeiServices,
IN EFI_PHYSICAL_ADDRESS MemoryBegin,
IN UINT64 MemoryLength
)
/*++
Routine Description:
Install the permanent memory is now available.
Creates HOB (PHIT and Stack).
Arguments:
PeiServices - The PEI core services table.
MemoryBegin - Start of memory address.
MemoryLength - Length of memory.
Returns:
Status - EFI_SUCCESS
--*/
;
EFI_STATUS
EFIAPI
PeiAllocatePages (
IN EFI_PEI_SERVICES **PeiServices,
IN EFI_MEMORY_TYPE MemoryType,
IN UINTN Pages,
OUT EFI_PHYSICAL_ADDRESS *Memory
)
/*++
Routine Description:
Memory allocation service on permanent memory,
not usable prior to the memory installation.
Arguments:
PeiServices - The PEI core services table.
Type - Type of allocation.
MemoryType - Type of memory to allocate.
Pages - Number of pages to allocate.
Memory - Pointer of memory allocated.
Returns:
Status - EFI_SUCCESS The allocation was successful
EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
EFI_NOT_AVAILABLE_YET Called with permanent memory not available
EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
to allocate the number of pages.
--*/
;
EFI_STATUS
EFIAPI
PeiAllocatePool (
IN EFI_PEI_SERVICES **PeiServices,
IN UINTN Size,
OUT VOID **Buffer
)
/*++
Routine Description:
Memory allocation service on the CAR.
Arguments:
PeiServices - The PEI core services table.
Size - Amount of memory required
Buffer - Address of pointer to the buffer
Returns:
Status - EFI_SUCCESS The allocation was successful
EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
to allocate the requested size.
--*/
;
VOID
EFIAPI
PeiCoreCopyMem (
IN VOID *Destination,
IN VOID *Source,
IN UINTN Length
)
/*++
Routine Description:
Copy Length bytes from Source to Destination.
Arguments:
Destination - Target of copy
Source - Place to copy from
Length - Number of bytes to copy
Returns:
None
--*/
;
VOID
EFIAPI
PeiCoreSetMem (
IN VOID *Buffer,
IN UINTN Size,
IN UINT8 Value
)
/*++
Routine Description:
Set Size bytes at Buffer address with Value
Arguments:
Buffer - Target of set
Size - Amount of memory to set
Value - Value to place in memory
Returns:
None
--*/
;
EFI_STATUS
PeiLoadImage (
IN EFI_PEI_SERVICES **PeiServices,
IN EFI_FFS_FILE_HEADER *PeimFileHeader,
OUT VOID **EntryPoint
)
/*++
Routine Description:
Get entry point of a Peim file.
Arguments:
PeiServices - Calling context.
PeimFileHeader - Peim file's header.
EntryPoint - Entry point of that Peim file.
Returns:
Status code.
--*/
;
EFI_STATUS
EFIAPI
PeiReportStatusCode (
IN EFI_PEI_SERVICES **PeiServices,
IN EFI_STATUS_CODE_TYPE CodeType,
IN EFI_STATUS_CODE_VALUE Value,
IN UINT32 Instance,
IN EFI_GUID *CallerId,
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
)
/*++
Routine Description:
Core version of the Status Code reporter
Arguments:
PeiServices - The PEI core services table.
CodeType - Type of Status Code.
Value - Value to output for Status Code.
Instance - Instance Number of this status code.
CallerId - ID of the caller of this status code.
Data - Optional data associated with this status code.
Returns:
Status - EFI_SUCCESS if status code is successfully reported
- EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
--*/
;
EFI_STATUS
EFIAPI
PeiCoreResetSystem (
IN EFI_PEI_SERVICES **PeiServices
)
/*++
Routine Description:
Core version of the Reset System
Arguments:
PeiServices - The PEI core services table.
Returns:
Status - EFI_NOT_AVAILABLE_YET. PPI not available yet.
- EFI_DEVICE_ERROR. Did not reset system.
Otherwise, resets the system.
--*/
;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -