THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
\r
- Module Name: PiPeiCis.h\r
-\r
@par Revision Reference:\r
Version 1.0.\r
\r
\r
#include <Pi/PiMultiPhase.h>\r
\r
-#define EFI_NOT_AVAILABLE_YET EFIERR (28)\r
-\r
//\r
// Handles of EFI FV/FFS.\r
// \r
-typedef VOID *EFI_PEI_FV_HANDLE;\r
-typedef VOID *EFI_PEI_FILE_HANDLE;\r
+typedef VOID *EFI_PEI_FV_HANDLE;\r
+typedef VOID *EFI_PEI_FILE_HANDLE;\r
\r
//\r
// Declare forward referenced data structures\r
#include <Ppi/CpuIo.h>\r
#include <Ppi/PciCfg2.h>\r
\r
+\r
/**\r
The PEI Dispatcher will invoke each PEIM one time. During this pass, the PEI \r
Dispatcher will pass control to the PEIM at the AddressOfEntryPoint in the PE Header. \r
typedef\r
EFI_STATUS\r
(EFIAPI *EFI_PEIM_ENTRY_POINT)(\r
- IN EFI_FFS_FILE_HEADER *FfsHeader,\r
+ IN EFI_PEI_FILE_HANDLE *FfsHeader,\r
IN EFI_PEI_SERVICES **PeiServices\r
);\r
\r
// this HOB is produced and consumed during the HOB producer phase.\r
// \r
typedef struct _EFI_HOB_LOAD_PEIM {\r
- EFI_HOB_GENERIC_HEADER Header;\r
- EFI_PEI_FILE_HANDLE FileHandle;\r
- EFI_PEIM_ENTRY_POINT EntryPoint;\r
- EFI_PEIM_ENTRY_POINT InMemEntryPoint;\r
+ EFI_HOB_GENERIC_HEADER Header;\r
+ EFI_PEI_FILE_HANDLE FileHandle;\r
+ EFI_PEIM_ENTRY_POINT EntryPoint;\r
+ EFI_PEIM_ENTRY_POINT InMemEntryPoint;\r
} EFI_HOB_LOAD_PEIM;\r
\r
\r
\r
/**\r
\r
- This service searches for files with a specific name, within\r
- either the specified firmware volume or all firmware volumes.\r
- The service returns a file handle of type EFI_PEI_FILE_HANDLE,\r
+ This service searches for files with a specific name, within\r
+ either the specified firmware volume or all firmware volumes.\r
+ The service returns a file handle of type EFI_PEI_FILE_HANDLE,\r
which must be unique within the system.\r
\r
- @param FileName A pointer to the name of the file to\r
- find within the firmware volume.\r
+ @param FileName A pointer to the name of the file to\r
+ find within the firmware volume.\r
\r
- @param VolumeHandle The firmware volume to search FileHandle\r
+ @param VolumeHandle The firmware volume to search FileHandle\r
Upon exit, points to the found file's\r
handle or NULL if it could not be found.\r
\r
- @retval EFI_SUCCESS File was found.\r
+ @retval EFI_SUCCESS File was found.\r
\r
- @retval EFI_NOT_FOUND File was not found.\r
+ @retval EFI_NOT_FOUND File was not found.\r
\r
- @retval EFI_INVALID_PARAMETER VolumeHandle or FileHandle or\r
- FileName was NULL.\r
+ @retval EFI_INVALID_PARAMETER VolumeHandle or FileHandle or\r
+ FileName was NULL.\r
\r
\r
**/\r
typedef\r
EFI_STATUS\r
(EFIAPI *EFI_PEI_FFS_FIND_BY_NAME) (\r
- IN CONST EFI_GUID *FileName,\r
- IN CONST EFI_PEI_FV_HANDLE VolumeHandle,\r
- OUT EFI_PEI_FILE_HANDLE *FileHandle\r
-);\r
+ IN CONST EFI_GUID *FileName,\r
+ IN CONST EFI_PEI_FV_HANDLE VolumeHandle,\r
+ OUT EFI_PEI_FILE_HANDLE *FileHandle\r
+ );\r
\r
\r
/**\r
\r
- @param FileName Name of the file.\r
+ @param FileName Name of the file.\r
\r
- @param FileType File type. See EFI_FV_FILETYPE, which is\r
+ @param FileType File type. See EFI_FV_FILETYPE, which is\r
defined in the Platform Initialization\r
Firmware Storage Specification.\r
\r
- @param FileAttributes Attributes of the file. Type\r
+ @param FileAttributes Attributes of the file. Type\r
EFI_FV_FILE_ATTRIBUTES is defined in\r
the Platform Initialization Firmware\r
Storage Specification.\r
\r
- @param Buffer Points to the file's data (not the header).\r
+ @param Buffer Points to the file's data (not the header).\r
Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED\r
is zero.\r
\r
- @param BufferSize Size of the file's data.\r
+ @param BufferSize Size of the file's data.\r
\r
**/\r
typedef struct {\r
- EFI_GUID FileName;\r
- EFI_FV_FILETYPE FileType;\r
- EFI_FV_FILE_ATTRIBUTES FileAttributes;\r
- VOID *Buffer;\r
- UINT32 BufferSize;\r
+ EFI_GUID FileName;\r
+ EFI_FV_FILETYPE FileType;\r
+ EFI_FV_FILE_ATTRIBUTES FileAttributes;\r
+ VOID *Buffer;\r
+ UINT32 BufferSize;\r
} EFI_FV_FILE_INFO;\r
\r
/**\r
\r
- This function returns information about a specific file,\r
- including its file name, type, attributes, starting address and\r
- size. If the firmware volume is not memory mapped then the\r
+ This function returns information about a specific file,\r
+ including its file name, type, attributes, starting address and\r
+ size. If the firmware volume is not memory mapped then the\r
Buffer member will be NULL.\r
\r
@param FileHandle Handle of the file.\r
@param FileInfo Upon exit, points to the file¡¯s\r
information.\r
\r
- @retval EFI_SUCCESS File information returned.\r
+ @retval EFI_SUCCESS File information returned.\r
\r
- @retval EFI_INVALID_PARAMETER If FileHandle does not\r
+ @retval EFI_INVALID_PARAMETER If FileHandle does not\r
represent a valid file.\r
\r
- @retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r
+ @retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r
\r
**/\r
typedef\r
EFI_STATUS\r
(EFIAPI *EFI_PEI_FFS_GET_FILE_INFO) (\r
- IN CONST EFI_PEI_FILE_HANDLE FileHandle,\r
- OUT EFI_FV_FILE_INFO *FileInfo\r
-);\r
+ IN CONST EFI_PEI_FILE_HANDLE FileHandle,\r
+ OUT EFI_FV_FILE_INFO *FileInfo\r
+ );\r
\r
\r
/**\r
\r
- @param FvAttributes Attributes of the firmware volume. Type\r
+ @param FvAttributes Attributes of the firmware volume. Type\r
EFI_FVB_ATTRIBUTES is defined in the\r
Platform Initialization Firmware Storage\r
Specficiation.\r
\r
- @param FvFormat Format of the firmware volume. For PI\r
+ @param FvFormat Format of the firmware volume. For PI\r
Architecture Firmware Volumes, this can\r
be copied from FileSystemGuid in\r
EFI_FIRMWARE_VOLUME_HEADER.\r
\r
- @param FvName Name of the firmware volume. For PI\r
+ @param FvName Name of the firmware volume. For PI\r
Architecture Firmware Volumes, this can\r
be copied from VolumeName in the\r
extended header of\r
EFI_FIRMWARE_VOLUME_HEADER.\r
\r
- @param FvStart Points to the first byte of the firmware\r
+ @param FvStart Points to the first byte of the firmware\r
volume, if bit EFI_FVB_MEMORY_MAPPED is\r
set in FvAttributes. FvSize Size of the\r
firmware volume.\r
\r
**/\r
typedef struct {\r
- EFI_FVB_ATTRIBUTES FvAttributes;\r
- EFI_GUID FvFormat;\r
- EFI_GUID FvName;\r
- VOID *FvStart;\r
- UINT64 FvSize;\r
+ EFI_FVB_ATTRIBUTES FvAttributes;\r
+ EFI_GUID FvFormat;\r
+ EFI_GUID FvName;\r
+ VOID *FvStart;\r
+ UINT64 FvSize;\r
} EFI_FV_INFO;\r
\r
/**\r
\r
- This function returns information about a specific firmware\r
- volume, including its name, type, attributes, starting address\r
+ This function returns information about a specific firmware\r
+ volume, including its name, type, attributes, starting address\r
and size.\r
\r
@param VolumeHandle Handle of the volume.\r
@param VolumeInfo Upon exit, points to the volume¡¯s\r
information.\r
\r
- @retval EFI_SUCCESS File information returned.\r
+ @retval EFI_SUCCESS File information returned.\r
\r
- @retval EFI_INVALID_PARAMETER If FileHandle does not\r
+ @retval EFI_INVALID_PARAMETER If FileHandle does not\r
represent a valid file.\r
\r
- @retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r
+ @retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r
\r
**/\r
typedef\r
EFI_STATUS\r
(EFIAPI *EFI_PEI_FFS_GET_VOLUME_INFO) (\r
- IN CONST EFI_PEI_FV_HANDLE *VolumeHandle,\r
- OUT EFI_FV_INFO *VolumeInfo\r
-);\r
+ IN CONST EFI_PEI_FV_HANDLE *VolumeHandle,\r
+ OUT EFI_FV_INFO *VolumeInfo\r
+ );\r
\r
/**\r
\r
- This service registers a file handle so that after memory is\r
- available, the PEIM will be re-loaded into permanent memory and\r
- re-initialized. The PEIM registered this way will always be\r
- initialized twice. The first time, this function call will\r
- return EFI_SUCCESS. The second time, this function call will\r
- return EFI_ALREADY_STARTED. Depending on the order in which\r
- PEIMs are dispatched, the PEIM making this call may be\r
- initialized after permanent memory is installed, even the first\r
+ This service registers a file handle so that after memory is\r
+ available, the PEIM will be re-loaded into permanent memory and\r
+ re-initialized. The PEIM registered this way will always be\r
+ initialized twice. The first time, this function call will\r
+ return EFI_SUCCESS. The second time, this function call will\r
+ return EFI_ALREADY_STARTED. Depending on the order in which\r
+ PEIMs are dispatched, the PEIM making this call may be\r
+ initialized after permanent memory is installed, even the first\r
time.\r
\r
- @param FileHandle PEIM¡¯s file handle. Must be the currently\r
+ @param FileHandle PEIM¡¯s file handle. Must be the currently\r
xecuting PEIM.\r
\r
- @retval EFI_SUCCESS The PEIM was successfully registered for\r
+ @retval EFI_SUCCESS The PEIM was successfully registered for\r
shadowing.\r
\r
- @retval EFI_ALREADY_STARTED The PEIM was previously\r
+ @retval EFI_ALREADY_STARTED The PEIM was previously\r
registered for shadowing.\r
\r
- @retval EFI_NOT_FOUND The FileHandle does not refer to a\r
- valid file handle.\r
+ @retval EFI_NOT_FOUND The FileHandle does not refer to a\r
+ valid file handle.\r
\r
**/\r
typedef\r
EFI_STATUS\r
(EFIAPI *EFI_PEI_REGISTER_FOR_SHADOW) (\r
- IN CONST EFI_PEI_FILE_HANDLE FileHandle\r
-);\r
+ IN CONST EFI_PEI_FILE_HANDLE FileHandle\r
+ );\r
\r
\r
//\r
//\r
// PEI Services Table\r
//\r
-#define PEI_SERVICES_SIGNATURE 0x5652455320494550\r
-#define PEI_SERVICES_REVISION (PEI_SPECIFICATION_MAJOR_REVISION<<16) | (PEI_SPECIFICATION_MINOR_REVISION)\r
-\r
-struct EFI_PEI_SERVICES {\r
- EFI_TABLE_HEADER Hdr;\r
- //\r
- // PPI Functions\r
- //\r
- EFI_PEI_INSTALL_PPI InstallPpi;\r
- EFI_PEI_REINSTALL_PPI ReInstallPpi;\r
- EFI_PEI_LOCATE_PPI LocatePpi;\r
- EFI_PEI_NOTIFY_PPI NotifyPpi;\r
- //\r
- // Boot Mode Functions\r
- //\r
- EFI_PEI_GET_BOOT_MODE GetBootMode;\r
- EFI_PEI_SET_BOOT_MODE SetBootMode;\r
- //\r
- // HOB Functions\r
- //\r
- EFI_PEI_GET_HOB_LIST GetHobList;\r
- EFI_PEI_CREATE_HOB CreateHob;\r
- //\r
- // Firmware Volume Functions\r
- //\r
- EFI_PEI_FFS_FIND_NEXT_VOLUME2 FfsFindNextVolume;\r
- EFI_PEI_FFS_FIND_NEXT_FILE2 FfsFindNextFile;\r
- EFI_PEI_FFS_FIND_SECTION_DATA2 FfsFindSectionData;\r
- //\r
- // PEI Memory Functions\r
- //\r
- EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory;\r
- EFI_PEI_ALLOCATE_PAGES AllocatePages;\r
- EFI_PEI_ALLOCATE_POOL AllocatePool;\r
- EFI_PEI_COPY_MEM CopyMem;\r
- EFI_PEI_SET_MEM SetMem;\r
- //\r
- // Status Code\r
- EFI_PEI_REPORT_STATUS_CODE ReportStatusCode;\r
- //\r
- // Reset\r
- //\r
- EFI_PEI_RESET_SYSTEM ResetSystem;\r
- //\r
- // (the following interfaces are installed by publishing PEIM)\r
- //\r
- // I/O Abstractions\r
- //\r
- EFI_PEI_CPU_IO_PPI *CpuIo;\r
- EFI_PEI_PCI_CFG2_PPI *PciCfg;\r
- //\r
- // Future Installed Services\r
- EFI_PEI_FFS_FIND_BY_NAME FfsFindFileByName;\r
- EFI_PEI_FFS_GET_FILE_INFO FfsGetFileInfo;\r
- EFI_PEI_FFS_GET_VOLUME_INFO FfsGetVolumeInfo;\r
- EFI_PEI_REGISTER_FOR_SHADOW RegisterForShadow;\r
-} ;\r
+#define PEI_SERVICES_SIGNATURE 0x5652455320494550\r
+#define PEI_SERVICES_REVISION (PEI_SPECIFICATION_MAJOR_REVISION<<16) | (PEI_SPECIFICATION_MINOR_REVISION)\r
+\r
+struct _EFI_PEI_SERVICES {\r
+ EFI_TABLE_HEADER Hdr;\r
+ //\r
+ // PPI Functions\r
+ //\r
+ EFI_PEI_INSTALL_PPI InstallPpi;\r
+ EFI_PEI_REINSTALL_PPI ReInstallPpi;\r
+ EFI_PEI_LOCATE_PPI LocatePpi;\r
+ EFI_PEI_NOTIFY_PPI NotifyPpi;\r
+ //\r
+ // Boot Mode Functions\r
+ //\r
+ EFI_PEI_GET_BOOT_MODE GetBootMode;\r
+ EFI_PEI_SET_BOOT_MODE SetBootMode;\r
+ //\r
+ // HOB Functions\r
+ //\r
+ EFI_PEI_GET_HOB_LIST GetHobList;\r
+ EFI_PEI_CREATE_HOB CreateHob;\r
+ //\r
+ // Firmware Volume Functions\r
+ //\r
+ EFI_PEI_FFS_FIND_NEXT_VOLUME2 FfsFindNextVolume;\r
+ EFI_PEI_FFS_FIND_NEXT_FILE2 FfsFindNextFile;\r
+ EFI_PEI_FFS_FIND_SECTION_DATA2 FfsFindSectionData;\r
+ //\r
+ // PEI Memory Functions\r
+ //\r
+ EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory;\r
+ EFI_PEI_ALLOCATE_PAGES AllocatePages;\r
+ EFI_PEI_ALLOCATE_POOL AllocatePool;\r
+ EFI_PEI_COPY_MEM CopyMem;\r
+ EFI_PEI_SET_MEM SetMem;\r
+ //\r
+ // Status Code\r
+ EFI_PEI_REPORT_STATUS_CODE ReportStatusCode;\r
+ //\r
+ // Reset\r
+ //\r
+ EFI_PEI_RESET_SYSTEM ResetSystem;\r
+ //\r
+ // (the following interfaces are installed by publishing PEIM)\r
+ //\r
+ // I/O Abstractions\r
+ //\r
+ EFI_PEI_CPU_IO_PPI *CpuIo;\r
+ EFI_PEI_PCI_CFG2_PPI *PciCfg;\r
+ //\r
+ // Future Installed Services\r
+ EFI_PEI_FFS_FIND_BY_NAME FfsFindFileByName;\r
+ EFI_PEI_FFS_GET_FILE_INFO FfsGetFileInfo;\r
+ EFI_PEI_FFS_GET_VOLUME_INFO FfsGetVolumeInfo;\r
+ EFI_PEI_REGISTER_FOR_SHADOW RegisterForShadow;\r
+};\r
\r
\r
typedef struct _EFI_SEC_PEI_HAND_OFF {\r
UINTN StackSize;\r
} EFI_SEC_PEI_HAND_OFF;\r
\r
+\r
+/**\r
+\r
+ This function is the entry point for the PEI Foundation, which\r
+ allows the SEC phase to pass information about the stack,\r
+ temporary RAM and the Boot Firmware Volume. In addition, it also\r
+ allows the SEC phase to pass services and data forward for use\r
+ during the PEI phase in the form of one or more PPIs. There is\r
+ no limit to the number of additional PPIs that can be passed\r
+ from SEC into the PEI Foundation. As part of its initialization\r
+ phase, the PEI Foundation will add these SEC-hosted PPIs to its\r
+ PPI database such that both the PEI Foundation and any modules\r
+ can leverage the associated service calls and/or code in these\r
+ early PPIs.\r
+\r
+ @param SecCoreData Points to a data structure containing\r
+ information about the PEI core's\r
+ operating environment, such as the size\r
+ and location of temporary RAM, the stack\r
+ location and the BFV location. The type\r
+ EFI_SEC_PEI_HAND_OFF is\r
+\r
+ @param PpiList Points to a list of one or more PPI\r
+ descriptors to be installed initially by\r
+ the PEI core. An empty PPI list consists\r
+ of a single descriptor with the end-tag\r
+ EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.\r
+ As part of its initialization phase, the\r
+ PEI Foundation will add these SEC-hosted\r
+ PPIs to its PPI database such that both\r
+ the PEI Foundation and any modules can\r
+ leverage the associated service calls\r
+ and/or code in these early PPIs.\r
+\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_PEI_CORE_ENTRY_POINT)(\r
+ IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r
+ IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList\r
+);\r
+\r
#endif\r