+ @param FileHandle File handle of a PEIM.\r
+\r
+ @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.\r
+ @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.\r
+ @retval EFI_SUCCESS Successfully to register itself.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiRegisterForShadow (\r
+ IN EFI_PEI_FILE_HANDLE FileHandle\r
+ );\r
+\r
+/**\r
+ Initialize image service that install PeiLoadFilePpi.\r
+\r
+ @param PrivateData Pointer to PeiCore's private data structure PEI_CORE_INSTANCE.\r
+ @param OldCoreData Pointer to Old PeiCore's private data.\r
+ If NULL, PeiCore is entered at first time, stack/heap in temporary memory.\r
+ If not NULL, PeiCore is entered at second time, stack/heap has been moved\r
+ to permenent memory.\r
+\r
+**/\r
+VOID\r
+InitializeImageServices (\r
+ IN PEI_CORE_INSTANCE *PrivateData,\r
+ IN PEI_CORE_INSTANCE *OldCoreData\r
+ );\r
+\r
+/**\r
+ The wrapper function of PeiLoadImageLoadImage().\r
+\r
+ @param This Pointer to EFI_PEI_LOAD_FILE_PPI.\r
+ @param FileHandle Pointer to the FFS file header of the image.\r
+ @param ImageAddressArg Pointer to PE/TE image.\r
+ @param ImageSizeArg Size of PE/TE image.\r
+ @param EntryPoint Pointer to entry point of specified image file for output.\r
+ @param AuthenticationState Pointer to attestation authentication state of image.\r
+\r
+ @return Status of PeiLoadImageLoadImage().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiLoadImageLoadImageWrapper (\r
+ IN CONST EFI_PEI_LOAD_FILE_PPI *This,\r
+ IN EFI_PEI_FILE_HANDLE FileHandle,\r
+ OUT EFI_PHYSICAL_ADDRESS *ImageAddressArg, OPTIONAL\r
+ OUT UINT64 *ImageSizeArg, OPTIONAL\r
+ OUT EFI_PHYSICAL_ADDRESS *EntryPoint,\r
+ OUT UINT32 *AuthenticationState\r
+ );\r
+\r
+/**\r
+\r
+ Provide a callback for when the security PPI is installed.\r
+\r
+ @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+ @param NotifyDescriptor The descriptor for the notification event.\r
+ @param Ppi Pointer to the PPI in question.\r
+\r
+ @return Always success\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SecurityPpiNotifyCallback (\r
+ IN EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r
+ IN VOID *Ppi\r
+ );\r
+\r
+/**\r
+ Get Fv image from the FV type file, then install FV INFO(2) ppi, Build FV hob.\r
+\r
+ @param PrivateData PeiCore's private data structure\r
+ @param ParentFvCoreHandle Pointer of EFI_CORE_FV_HANDLE to parent Fv image that contain this Fv image.\r
+ @param ParentFvFileHandle File handle of a Fv type file that contain this Fv image.\r
+\r
+ @retval EFI_NOT_FOUND FV image can't be found.\r
+ @retval EFI_SUCCESS Successfully to process it.\r
+ @retval EFI_OUT_OF_RESOURCES Can not allocate page when aligning FV image\r
+ @retval EFI_SECURITY_VIOLATION Image is illegal\r
+ @retval Others Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section\r
+ \r
+**/\r
+EFI_STATUS\r
+ProcessFvFile (\r
+ IN PEI_CORE_INSTANCE *PrivateData,\r
+ IN PEI_CORE_FV_HANDLE *ParentFvCoreHandle,\r
+ IN EFI_PEI_FILE_HANDLE ParentFvFileHandle\r
+ );\r
+ \r
+/**\r
+ Get instance of PEI_CORE_FV_HANDLE for next volume according to given index.\r
+ \r
+ This routine also will install FvInfo ppi for FV hob in PI ways.\r
+ \r
+ @param Private Pointer of PEI_CORE_INSTANCE\r
+ @param Instance The index of FV want to be searched.\r
+ \r
+ @return Instance of PEI_CORE_FV_HANDLE.\r
+**/\r
+PEI_CORE_FV_HANDLE *\r
+FindNextCoreFvHandle (\r
+ IN PEI_CORE_INSTANCE *Private,\r
+ IN UINTN Instance\r
+ );\r
+ \r
+//\r
+// Default EFI_PEI_CPU_IO_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.\r
+// \r
+\r
+/**\r
+ Memory-based read services.\r
+ \r
+ This function is to perform the Memory Access Read service based on installed \r
+ instance of the EFI_PEI_CPU_IO_PPI. \r
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
+ return EFI_NOT_YET_AVAILABLE. \r
+ \r
+ @param PeiServices An indirect pointer to the PEI Services Table\r
+ published by the PEI Foundation.\r
+ @param This Pointer to local data for the interface.\r
+ @param Width The width of the access. Enumerated in bytes.\r
+ @param Address The physical address of the access.\r
+ @param Count The number of accesses to perform.\r
+ @param Buffer A pointer to the buffer of data.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully.\r
+ @retval EFI_NOT_YET_AVAILABLE The service has not been installed. \r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiDefaultMemRead (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN CONST EFI_PEI_CPU_IO_PPI *This,\r
+ IN EFI_PEI_CPU_IO_PPI_WIDTH Width,\r
+ IN UINT64 Address,\r
+ IN UINTN Count,\r
+ IN OUT VOID *Buffer\r
+ );\r
+ \r
+/**\r
+ Memory-based write services.\r
+ \r
+ This function is to perform the Memory Access Write service based on installed \r
+ instance of the EFI_PEI_CPU_IO_PPI. \r
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
+ return EFI_NOT_YET_AVAILABLE. \r
+ \r
+ @param PeiServices An indirect pointer to the PEI Services Table\r
+ published by the PEI Foundation.\r
+ @param This Pointer to local data for the interface.\r
+ @param Width The width of the access. Enumerated in bytes.\r
+ @param Address The physical address of the access.\r
+ @param Count The number of accesses to perform.\r
+ @param Buffer A pointer to the buffer of data.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully.\r
+ @retval EFI_NOT_YET_AVAILABLE The service has not been installed. \r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiDefaultMemWrite (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN CONST EFI_PEI_CPU_IO_PPI *This,\r
+ IN EFI_PEI_CPU_IO_PPI_WIDTH Width,\r
+ IN UINT64 Address,\r
+ IN UINTN Count,\r
+ IN OUT VOID *Buffer\r
+ );\r
+ \r
+/**\r
+ IO-based read services.\r
+ \r
+ This function is to perform the IO-base read service for the EFI_PEI_CPU_IO_PPI.\r
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
+ return EFI_NOT_YET_AVAILABLE. \r
+ \r
+ @param PeiServices An indirect pointer to the PEI Services Table\r
+ published by the PEI Foundation.\r
+ @param This Pointer to local data for the interface.\r
+ @param Width The width of the access. Enumerated in bytes.\r
+ @param Address The physical address of the access.\r
+ @param Count The number of accesses to perform.\r
+ @param Buffer A pointer to the buffer of data.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully.\r
+ @retval EFI_NOT_YET_AVAILABLE The service has not been installed.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiDefaultIoRead (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN CONST EFI_PEI_CPU_IO_PPI *This,\r
+ IN EFI_PEI_CPU_IO_PPI_WIDTH Width,\r
+ IN UINT64 Address,\r
+ IN UINTN Count,\r
+ IN OUT VOID *Buffer\r
+ );\r
+ \r
+/**\r
+ IO-based write services.\r
+ \r
+ This function is to perform the IO-base write service for the EFI_PEI_CPU_IO_PPI.\r
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
+ return EFI_NOT_YET_AVAILABLE. \r
+ \r
+ @param PeiServices An indirect pointer to the PEI Services Table\r
+ published by the PEI Foundation.\r
+ @param This Pointer to local data for the interface.\r
+ @param Width The width of the access. Enumerated in bytes.\r
+ @param Address The physical address of the access.\r
+ @param Count The number of accesses to perform.\r
+ @param Buffer A pointer to the buffer of data.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully.\r
+ @retval EFI_NOT_YET_AVAILABLE The service has not been installed.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiDefaultIoWrite (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN CONST EFI_PEI_CPU_IO_PPI *This,\r
+ IN EFI_PEI_CPU_IO_PPI_WIDTH Width,\r
+ IN UINT64 Address,\r
+ IN UINTN Count,\r
+ IN OUT VOID *Buffer\r
+ );\r
+ \r
+/**\r
+ 8-bit I/O read operations.\r
+ \r
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
+ return 0.\r
+ \r
+ @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
+ @param This Pointer to local data for the interface.\r
+ @param Address The physical address of the access.\r
+\r
+ @return An 8-bit value returned from the I/O space.\r
+**/\r
+UINT8\r
+EFIAPI\r
+PeiDefaultIoRead8 (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN CONST EFI_PEI_CPU_IO_PPI *This,\r
+ IN UINT64 Address\r
+ );\r
+ \r
+/**\r
+ Reads an 16-bit I/O port.\r
+ \r
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
+ return 0.\r
+ \r
+ @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
+ @param This Pointer to local data for the interface.\r
+ @param Address The physical address of the access.\r
+\r
+ @return A 16-bit value returned from the I/O space.\r
+**/\r
+UINT16\r
+EFIAPI\r
+PeiDefaultIoRead16 (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN CONST EFI_PEI_CPU_IO_PPI *This,\r
+ IN UINT64 Address\r
+ );\r
+ \r
+/**\r
+ Reads an 32-bit I/O port.\r
+ \r
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
+ return 0.\r
+ \r
+ @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
+ @param This Pointer to local data for the interface.\r
+ @param Address The physical address of the access.\r
+\r
+ @return A 32-bit value returned from the I/O space.\r
+**/\r
+UINT32\r
+EFIAPI\r
+PeiDefaultIoRead32 (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN CONST EFI_PEI_CPU_IO_PPI *This,\r
+ IN UINT64 Address\r
+ );\r
+ \r
+/**\r
+ Reads an 64-bit I/O port.\r
+ \r
+ If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
+ return 0.\r
+ \r
+ @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
+ @param This Pointer to local data for the interface.\r
+ @param Address The physical address of the access.\r
+\r
+ @return A 64-bit value returned from the I/O space.\r
+**/\r
+UINT64\r
+EFIAPI\r
+PeiDefaultIoRead64 (\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN CONST EFI_PEI_CPU_IO_PPI *This,\r
+ IN UINT64 Address\r
+ );\r
+ \r
+/**\r
+ 8-bit I/O write operations.\r