59#define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE 0xff
73#define PPI_GROWTH_STEP 64
74#define CALLBACK_NOTIFY_GROWTH_STEP 32
75#define DISPATCH_NOTIFY_GROWTH_STEP 8
80 UINTN LastDispatchedCount;
99 UINTN LastDispatchedCount;
130#define PEIM_STATE_NOT_DISPATCHED 0x00
131#define PEIM_STATE_DISPATCHED 0x01
132#define PEIM_STATE_REGISTER_FOR_SHADOW 0x02
133#define PEIM_STATE_DONE 0x03
138#define FV_GROWTH_STEP 8
154 UINT32 AuthenticationStatus;
161 UINT32 AuthenticationStatus;
165#define CACHE_SETION_MAX_NUMBER 0x10
168 VOID *SectionData[CACHE_SETION_MAX_NUMBER];
169 UINTN SectionSize[CACHE_SETION_MAX_NUMBER];
170 UINT32 AuthenticationStatus[CACHE_SETION_MAX_NUMBER];
171 UINTN AllSectionCount;
175#define HOLE_MAX_NUMBER 0x3
180 BOOLEAN OffsetPositive;
212#define TEMP_FILE_GROWTH_STEP 32
214#define PEI_CORE_HANDLE_SIGNATURE SIGNATURE_32('P','e','i','C')
231#define GET_TIME_IN_US() ((UINT32)DivU64x32(GetTimeInNanoSecond(GetPerformanceCounter ()), 1000))
266 UINTN MaxUnknownFvInfoCount;
267 UINTN UnknownFvInfoCount;
274 UINTN CurrentPeimFvCount;
275 UINTN CurrentPeimCount;
277 BOOLEAN PeimNeedingDispatch;
278 BOOLEAN PeimDispatchOnThisPass;
279 BOOLEAN PeimDispatcherReenter;
281 BOOLEAN SwitchStackSignal;
282 BOOLEAN PeiMemoryInstalled;
288 UINT64 PhysicalMemoryLength;
291 BOOLEAN HeapOffsetPositive;
293 BOOLEAN StackOffsetPositive;
311 UINT64 *PeiCodeMemoryRangeUsageBitMap;
343#define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
344 CR(a, PEI_CORE_INSTANCE, Ps, PEI_CORE_HANDLE_SIGNATURE)
423 IN VOID *DependencyExpression
705 IN INTN InstallStartIndex,
813 IN UINT32 AuthenticationStatus
833 IN OUT VOID **HobList
874 IN UINT64 MemoryLength
944 IN EFI_SECTION_TYPE SectionType,
948 OUT VOID **OutputBuffer,
949 OUT UINT32 *AuthenticationStatus,
970 IN EFI_SECTION_TYPE SectionType,
972 OUT VOID **SectionData
993 IN EFI_SECTION_TYPE SectionType,
996 OUT VOID **SectionData,
997 OUT UINT32 *AuthenticationStatus
1060 IN UINT64 MemoryLength
1074 IN BOOLEAN TemporaryRamMigrated
1201 OUT UINT32 *AuthenticationState
1268 IN VOID *ResetData OPTIONAL
1424 IN VOID *ImageAddress
1462 OUT UINT64 *ImageSizeArg OPTIONAL,
1464 OUT UINT32 *AuthenticationState
STATIC VOID ClearBits(IN EFI_PHYSICAL_ADDRESS Address, IN UINTN BitNumber, IN UINT64 *BitMap)
STATIC VOID SetBits(IN EFI_PHYSICAL_ADDRESS Address, IN UINTN BitNumber, IN UINT64 *BitMap)
VOID(EFIAPI * EFI_DELAYED_DISPATCH_FUNCTION)(IN OUT UINT64 *Context, OUT UINT32 *NewDelay)
EFI_PEI_PCI_CFG_PPI_WIDTH
RETURN_STATUS(EFIAPI * PE_COFF_LOADER_READ_FILE)(IN VOID *FileHandle, IN UINTN FileOffset, IN OUT UINTN *ReadSize, OUT VOID *Buffer)
EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi
UINT64 EFIAPI PeiDefaultIoRead64(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
EFI_STATUS EFIAPI PeiLocatePpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
EFI_STATUS EFIAPI PeiInstallPeiMemory(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_PHYSICAL_ADDRESS MemoryBegin, IN UINT64 MemoryLength)
VOID ConvertPeiCorePpiPointers(IN PEI_CORE_INSTANCE *PrivateData, IN PEI_CORE_FV_HANDLE *CoreFvHandle)
VOID EFIAPI PeiResetSystem2(IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)
EFI_STATUS EFIAPI PeiFfsGetVolumeInfo(IN EFI_PEI_FV_HANDLE VolumeHandle, OUT EFI_FV_INFO *VolumeInfo)
VOID ConvertMemoryAllocationHobs(IN PEI_CORE_INSTANCE *PrivateData)
EFI_STATUS EFIAPI PeiFfsFindFileByName(IN CONST EFI_GUID *FileName, IN EFI_PEI_FV_HANDLE VolumeHandle, OUT EFI_PEI_FILE_HANDLE *FileHandle)
EFI_STATUS EFIAPI PeiDelayedDispatchRegister(IN EFI_DELAYED_DISPATCH_PPI *This, IN EFI_DELAYED_DISPATCH_FUNCTION Function, IN UINT64 Context, IN EFI_GUID *DelayedGroupId OPTIONAL, IN UINT32 Delay)
VOID InitializeImageServices(IN PEI_CORE_INSTANCE *PrivateData, IN PEI_CORE_INSTANCE *OldCoreData)
VOID InitializeDispatcherData(IN PEI_CORE_INSTANCE *PrivateData, IN PEI_CORE_INSTANCE *OldCoreData, IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData)
EFI_STATUS(EFIAPI * PEICORE_FUNCTION_POINTER)(IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList, IN PEI_CORE_INSTANCE *OldCoreData)
VOID ConvertFvHob(IN PEI_CORE_INSTANCE *PrivateData, IN UINTN OrgFvHandle, IN UINTN FvHandle)
VOID MigrateMemoryPages(IN PEI_CORE_INSTANCE *Private, IN BOOLEAN TemporaryRamMigrated)
EFI_STATUS EFIAPI MigratePeim(IN EFI_PEI_FILE_HANDLE FileHandle, IN EFI_PEI_FILE_HANDLE MigratedFileHandle)
EFI_STATUS EFIAPI PeiDefaultPciCfg2Read(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PCI_CFG2_PPI *This, IN EFI_PEI_PCI_CFG_PPI_WIDTH Width, IN UINT64 Address, IN OUT VOID *Buffer)
VOID EFIAPI PeiDefaultMemWrite8(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT8 Data)
VOID ProcessNotify(IN PEI_CORE_INSTANCE *PrivateData, IN UINTN NotifyType, IN INTN InstallStartIndex, IN INTN InstallStopIndex, IN INTN NotifyStartIndex, IN INTN NotifyStopIndex)
PEI_CORE_FV_HANDLE * FindNextCoreFvHandle(IN PEI_CORE_INSTANCE *Private, IN UINTN Instance)
VOID PeiReinitializeFv(IN PEI_CORE_INSTANCE *PrivateData)
EFI_STATUS EFIAPI PeiDefaultPciCfg2Modify(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PCI_CFG2_PPI *This, IN EFI_PEI_PCI_CFG_PPI_WIDTH Width, IN UINT64 Address, IN VOID *SetBits, IN VOID *ClearBits)
VOID InitializeSecurityServices(IN EFI_PEI_SERVICES **PeiServices, IN PEI_CORE_INSTANCE *OldCoreData)
EFI_STATUS EFIAPI PeiFfsFindSectionData3(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_SECTION_TYPE SectionType, IN UINTN SectionInstance, IN EFI_PEI_FILE_HANDLE FileHandle, OUT VOID **SectionData, OUT UINT32 *AuthenticationStatus)
EFI_STATUS EFIAPI PeiGetHobList(IN CONST EFI_PEI_SERVICES **PeiServices, IN OUT VOID **HobList)
EFI_STATUS EFIAPI PeiInstallPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
VOID ProcessDispatchNotifyList(IN PEI_CORE_INSTANCE *PrivateData)
EFI_STATUS EFIAPI PeiFfsGetFileInfo(IN EFI_PEI_FILE_HANDLE FileHandle, OUT EFI_FV_FILE_INFO *FileInfo)
VOID PeiDispatcher(IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, IN PEI_CORE_INSTANCE *PrivateData)
EFI_STATUS EFIAPI PeiDefaultMemWrite(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN EFI_PEI_CPU_IO_PPI_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
EFI_STATUS EFIAPI PeiReInstallPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi, IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi)
EFI_STATUS VerifyFv(IN EFI_FIRMWARE_VOLUME_HEADER *CurrentFvAddress)
BOOLEAN PeimDispatchReadiness(IN EFI_PEI_SERVICES **PeiServices, IN VOID *DependencyExpression)
EFI_STATUS PeiLoadImage(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_FILE_HANDLE FileHandle, IN UINT8 PeimState, OUT EFI_PHYSICAL_ADDRESS *EntryPoint, OUT UINT32 *AuthenticationState)
EFI_STATUS EFIAPI PeiDefaultPciCfg2Write(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PCI_CFG2_PPI *This, IN EFI_PEI_PCI_CFG_PPI_WIDTH Width, IN UINT64 Address, IN OUT VOID *Buffer)
VOID EFIAPI PeiDefaultMemWrite16(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT16 Data)
VOID EFIAPI PeiDefaultMemWrite64(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT64 Data)
EFI_STATUS EFIAPI PeiResetSystem(IN CONST EFI_PEI_SERVICES **PeiServices)
EFI_STATUS EFIAPI PeiFreePages(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN Pages)
EFI_STATUS EFIAPI PeiFfsGetFileInfo2(IN EFI_PEI_FILE_HANDLE FileHandle, OUT EFI_FV_FILE_INFO2 *FileInfo)
UINT16 EFIAPI PeiDefaultMemRead16(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
EFI_STATUS VerifyPeim(IN PEI_CORE_INSTANCE *PrivateData, IN EFI_PEI_FV_HANDLE VolumeHandle, IN EFI_PEI_FILE_HANDLE FileHandle, IN UINT32 AuthenticationStatus)
EFI_STATUS EFIAPI FirmwareVolumeInfoPpiNotifyCallback(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
EFI_STATUS LoadAndRelocatePeCoffImageInPlace(IN VOID *Pe32Data, IN VOID *ImageAddress)
UINT32 EFIAPI PeiDefaultIoRead32(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
EFI_STATUS EFIAPI PeiDefaultMemRead(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN EFI_PEI_CPU_IO_PPI_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
VOID PeiInitializeFv(IN PEI_CORE_INSTANCE *PrivateData, IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData)
UINT8 EFIAPI PeiDefaultIoRead8(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
EFI_STATUS EFIAPI PeiAllocatePages(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT EFI_PHYSICAL_ADDRESS *Memory)
UINT32 EFIAPI PeiDefaultMemRead32(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
EFI_STATUS EFIAPI PeiFfsFindNextVolume(IN CONST EFI_PEI_SERVICES **PeiServices, IN UINTN Instance, IN OUT EFI_PEI_FV_HANDLE *VolumeHandle)
EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi
VOID EFIAPI PeiCore(IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList, IN VOID *Data)
EFI_STATUS PeiInstallSecHobData(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_HOB_GENERIC_HEADER *SecHobList)
EFI_STATUS EFIAPI PeiFfsFindSectionData(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_SECTION_TYPE SectionType, IN EFI_PEI_FILE_HANDLE FileHandle, OUT VOID **SectionData)
VOID DumpPpiList(IN PEI_CORE_INSTANCE *PrivateData)
VOID ConvertPpiPointersFv(IN PEI_CORE_INSTANCE *PrivateData, IN UINTN OrgFvHandle, IN UINTN FvHandle, IN UINTN FvSize)
BOOLEAN DepexSatisfied(IN PEI_CORE_INSTANCE *Private, IN EFI_PEI_FILE_HANDLE FileHandle, IN UINTN PeimCount)
VOID EFIAPI PeiDefaultIoWrite16(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT16 Data)
EFI_STATUS EFIAPI PeiDelayedDispatchWaitOnEvent(IN EFI_DELAYED_DISPATCH_PPI *This, IN EFI_GUID DelayedGroupId)
VOID ConvertPpiPointers(IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, IN PEI_CORE_INSTANCE *PrivateData)
EFI_STATUS EFIAPI PeiDefaultIoWrite(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN EFI_PEI_CPU_IO_PPI_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
UINT8 EFIAPI PeiDefaultMemRead8(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
EFI_STATUS EFIAPI PeiFfsFindNextFile(IN CONST EFI_PEI_SERVICES **PeiServices, IN UINT8 SearchType, IN EFI_PEI_FV_HANDLE FvHandle, IN OUT EFI_PEI_FILE_HANDLE *FileHandle)
VOID ProcessPpiListFromSec(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
EFI_STATUS EFIAPI PeiNotifyPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList)
EFI_STATUS EFIAPI PeiGetBootMode(IN CONST EFI_PEI_SERVICES **PeiServices, IN OUT EFI_BOOT_MODE *BootMode)
VOID InitializePpiServices(IN PEI_CORE_INSTANCE *PrivateData, IN PEI_CORE_INSTANCE *OldCoreData)
VOID InitializeMemoryServices(IN PEI_CORE_INSTANCE *PrivateData, IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, IN PEI_CORE_INSTANCE *OldCoreData)
EFI_STATUS ProcessSection(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_SECTION_TYPE SectionType, IN OUT UINTN *SectionInstance, IN EFI_COMMON_SECTION_HEADER *Section, IN UINTN SectionSize, OUT VOID **OutputBuffer, OUT UINT32 *AuthenticationStatus, IN BOOLEAN IsFfs3Fv)
EFI_STATUS EFIAPI PeiCreateHob(IN CONST EFI_PEI_SERVICES **PeiServices, IN UINT16 Type, IN UINT16 Length, IN OUT VOID **Hob)
UINT64 EFIAPI PeiDefaultMemRead64(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
EFI_STATUS EFIAPI PeiAllocatePool(IN CONST EFI_PEI_SERVICES **PeiServices, IN UINTN Size, OUT VOID **Buffer)
UINT16 EFIAPI PeiDefaultIoRead16(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
EFI_STATUS PeiGetPe32Data(IN EFI_PEI_FILE_HANDLE FileHandle, OUT VOID **Pe32Data)
VOID EFIAPI PeiDefaultMemWrite32(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT32 Data)
VOID EFIAPI PeiDefaultIoWrite8(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT8 Data)
VOID EFIAPI PeiDefaultIoWrite32(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT32 Data)
EFI_STATUS EFIAPI PeiRegisterForShadow(IN EFI_PEI_FILE_HANDLE FileHandle)
EFI_STATUS ProcessFvFile(IN PEI_CORE_INSTANCE *PrivateData, IN PEI_CORE_FV_HANDLE *ParentFvCoreHandle, IN EFI_PEI_FILE_HANDLE ParentFvFileHandle)
VOID EFIAPI PeiDefaultIoWrite64(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT64 Data)
EFI_STATUS EFIAPI EvacuateTempRam(IN PEI_CORE_INSTANCE *Private, IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData)
EFI_STATUS EFIAPI PeiReportStatusCode(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN CONST EFI_GUID *CallerId, IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL)
EFI_STATUS EFIAPI PeiDefaultIoRead(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN EFI_PEI_CPU_IO_PPI_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
EFI_STATUS EFIAPI SecurityPpiNotifyCallback(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
EFI_STATUS EFIAPI PeiSetBootMode(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_BOOT_MODE BootMode)
EFI_STATUS PeiCoreBuildHobHandoffInfoTable(IN EFI_BOOT_MODE BootMode, IN EFI_PHYSICAL_ADDRESS MemoryBegin, IN UINT64 MemoryLength)
EFI_STATUS EFIAPI PeiLoadImageLoadImageWrapper(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 PeimEntry(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
EFI_STATUS(EFIAPI * EFI_PEIM_ENTRY_POINT2)(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
VOID * EFI_PEI_FILE_HANDLE
EFI_STATUS(EFIAPI * EFI_PEIM_NOTIFY_ENTRY_POINT)(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
UINT32 EFI_STATUS_CODE_VALUE
UINT32 EFI_STATUS_CODE_TYPE
EFI_FILE_INFO * FileInfo(IN EFI_FILE_HANDLE FHand)
UINT64 EFI_PHYSICAL_ADDRESS
PEI_CORE_UNKNOW_FORMAT_FV_INFO * UnknownFvInfo
EFI_PEI_FILE_HANDLE * CurrentFvFileHandles
PEI_PPI_LIST_POINTERS * NotifyPtrs
PEI_PPI_LIST_POINTERS * NotifyPtrs
PEI_CALLBACK_NOTIFY_LIST CallbackNotifyList
PEI_DISPATCH_NOTIFY_LIST DispatchNotifyList
PEI_PPI_LIST_POINTERS * PpiPtrs