]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/PeiMain.h
PEI Core: Remove unused variable in PeiLoadImageLoadImage function.
[mirror_edk2.git] / MdeModulePkg / Core / Pei / PeiMain.h
index 0524d95636773a54cc4c79ba2f65b9d53f04e78c..1d96cc43f8e3a4ffb55f1f966e290ee105fb3f44 100644 (file)
@@ -43,7 +43,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <IndustryStandard/PeImage.h>\r
 #include <Library/PeiServicesTablePointerLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
-#include <Library/PeiPiLib.h>\r
 #include <Guid/FirmwareFileSystem2.h>\r
 #include <Guid/AprioriFileName.h>\r
 \r
@@ -121,7 +120,7 @@ typedef struct {
 } CACHE_SECTION_DATA;\r
 \r
 \r
-#define PEI_CORE_HANDLE_SIGNATURE  EFI_SIGNATURE_32('P','e','i','C')\r
+#define PEI_CORE_HANDLE_SIGNATURE  SIGNATURE_32('P','e','i','C')\r
 \r
 ///\r
 /// Pei Core private data structure instance\r
@@ -147,14 +146,9 @@ typedef struct{
   BOOLEAN                            PeiMemoryInstalled;\r
   EFI_PHYSICAL_ADDRESS               StackBase;\r
   UINT64                             StackSize;\r
-  VOID                               *BottomOfCarHeap;\r
-  VOID                               *TopOfCarHeap;\r
   VOID                               *CpuIo;\r
   EFI_PEI_SECURITY2_PPI              *PrivateSecurityPpi;\r
   EFI_PEI_SERVICES                   ServiceTableShadow;\r
-  UINTN                              SizeOfTemporaryMemory;\r
-  UINTN                              SizeOfCacheAsRam;\r
-  VOID                               *MaxTopOfCarHeap;\r
   EFI_PEI_PPI_DESCRIPTOR             *XipLoadFile;\r
   EFI_PHYSICAL_ADDRESS               PhysicalMemoryBegin;\r
   UINT64                             PhysicalMemoryLength;\r
@@ -171,16 +165,15 @@ typedef struct{
 \r
 /**\r
   Function Pointer type for PeiCore function.\r
-  @param SecCoreData     Points to a data structure containing information about the PEI core's operating\r
-                         environment, such as the size and location of temporary RAM, the stack location and\r
-                         the BFV location.\r
+  @param SecCoreData     Points to a data structure containing SEC to PEI handoff data, such as the size \r
+                         and location of temporary RAM, the stack location and the BFV location.\r
   @param PpiList         Points to a list of one or more PPI descriptors to be installed initially by the PEI core.\r
                          An empty PPI list consists of a single descriptor with the end-tag\r
                          EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization\r
                          phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such\r
                          that both the PEI Foundation and any modules can leverage the associated service\r
                          calls and/or code in these early PPIs\r
-  @param Data            Pointer to old core data that is used to initialize the\r
+  @param OldCoreData     Pointer to old core data that is used to initialize the\r
                          core's data areas.\r
 **/\r
 typedef\r
@@ -220,9 +213,8 @@ typedef struct {
   with the old core data.\r
 \r
 \r
-  @param SecCoreData     Points to a data structure containing information about the PEI core's operating\r
-                         environment, such as the size and location of temporary RAM, the stack location and\r
-                         the BFV location.\r
+  @param SecCoreData     Points to a data structure containing SEC to PEI handoff data, such as the size \r
+                         and location of temporary RAM, the stack location and the BFV location.\r
   @param PpiList         Points to a list of one or more PPI descriptors to be installed initially by the PEI core.\r
                          An empty PPI list consists of a single descriptor with the end-tag\r
                          EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization\r
@@ -232,17 +224,14 @@ typedef struct {
   @param Data            Pointer to old core data that is used to initialize the\r
                          core's data areas.\r
 \r
-  @retval EFI_NOT_FOUND  Never reach\r
-\r
 **/\r
-EFI_STATUS\r
+VOID\r
 EFIAPI\r
 PeiCore (\r
   IN CONST EFI_SEC_PEI_HAND_OFF        *SecCoreData,\r
-  IN CONST EFI_PEI_PPI_DESCRIPTOR      *PpList,\r
+  IN CONST EFI_PEI_PPI_DESCRIPTOR      *PpiList,\r
   IN VOID                              *Data\r
-  )\r
-;\r
+  );\r
 \r
 //\r
 // Dispatcher support functions\r
@@ -272,8 +261,7 @@ BOOLEAN
 PeimDispatchReadiness (\r
   IN EFI_PEI_SERVICES   **PeiServices,\r
   IN VOID               *DependencyExpression\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Conduct PEIM dispatch.\r
@@ -281,16 +269,12 @@ PeimDispatchReadiness (
   @param SecCoreData     Pointer to the data structure containing SEC to PEI handoff data\r
   @param PrivateData     Pointer to the private data passed in from caller\r
 \r
-  @retval EFI_SUCCESS    Successfully dispatched PEIM.\r
-  @retval EFI_NOT_FOUND  The dispatch failed.\r
-\r
 **/\r
 VOID\r
 PeiDispatcher (\r
   IN CONST EFI_SEC_PEI_HAND_OFF  *SecCoreData,\r
   IN PEI_CORE_INSTANCE           *PrivateData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Initialize the Dispatcher's data members\r
@@ -298,9 +282,8 @@ PeiDispatcher (
   @param PrivateData     PeiCore's private data structure\r
   @param OldCoreData     Old data from SecCore\r
                          NULL if being run in non-permament memory mode.\r
-  @param SecCoreData     Points to a data structure containing information about the PEI core's operating\r
-                         environment, such as the size and location of temporary RAM, the stack location and\r
-                         the BFV location.\r
+  @param SecCoreData     Points to a data structure containing SEC to PEI handoff data, such as the size\r
+                         and location of temporary RAM, the stack location and the BFV location.\r
 \r
 **/\r
 VOID\r
@@ -308,8 +291,7 @@ InitializeDispatcherData (
   IN PEI_CORE_INSTANCE            *PrivateData,\r
   IN PEI_CORE_INSTANCE            *OldCoreData,\r
   IN CONST EFI_SEC_PEI_HAND_OFF   *SecCoreData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   This routine parses the Dependency Expression, if available, and\r
@@ -329,8 +311,7 @@ DepexSatisfied (
   IN PEI_CORE_INSTANCE          *Private,\r
   IN EFI_PEI_FILE_HANDLE        FileHandle,\r
   IN UINTN                      PeimCount\r
-  )\r
-;\r
+  );\r
 \r
 //\r
 // PPI support functions\r
@@ -348,12 +329,11 @@ VOID
 InitializePpiServices (\r
   IN PEI_CORE_INSTANCE   *PrivateData,\r
   IN PEI_CORE_INSTANCE   *OldCoreData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
-  Migrate the Hob list from the CAR stack to PEI installed memory.\r
+  Migrate the Hob list from the temporary memory stack to PEI installed memory.\r
 \r
   @param PrivateData         Pointer to PeiCore's private data structure.\r
   @param OldCheckingBottom   Bottom of temporary memory range. All Ppi in this range\r
@@ -370,8 +350,7 @@ ConvertPpiPointers (
   IN UINTN                   OldCheckingBottom,\r
   IN UINTN                   OldCheckingTop,\r
   IN INTN                    Fixup\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -391,8 +370,7 @@ EFIAPI
 PeiInstallPpi (\r
   IN CONST EFI_PEI_SERVICES        **PeiServices,\r
   IN CONST EFI_PEI_PPI_DESCRIPTOR  *PpiList\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -414,8 +392,7 @@ PeiReInstallPpi (
   IN CONST EFI_PEI_SERVICES        **PeiServices,\r
   IN CONST EFI_PEI_PPI_DESCRIPTOR  *OldPpi,\r
   IN CONST EFI_PEI_PPI_DESCRIPTOR  *NewPpi\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -441,8 +418,7 @@ PeiLocatePpi (
   IN UINTN                       Instance,\r
   IN OUT EFI_PEI_PPI_DESCRIPTOR  **PpiDescriptor,\r
   IN OUT VOID                    **Ppi\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -462,8 +438,7 @@ EFIAPI
 PeiNotifyPpi (\r
   IN CONST EFI_PEI_SERVICES           **PeiServices,\r
   IN CONST EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyList\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -475,8 +450,7 @@ PeiNotifyPpi (
 VOID\r
 ProcessNotifyList (\r
   IN PEI_CORE_INSTANCE  *PrivateData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -498,8 +472,7 @@ DispatchNotify (
   IN INTN                InstallStopIndex,\r
   IN INTN                NotifyStartIndex,\r
   IN INTN                NotifyStopIndex\r
-  )\r
-;\r
+  );\r
 \r
 //\r
 // Boot mode support functions\r
@@ -518,9 +491,8 @@ EFI_STATUS
 EFIAPI\r
 PeiGetBootMode (\r
   IN CONST EFI_PEI_SERVICES  **PeiServices,\r
-  IN OUT EFI_BOOT_MODE *BootMode\r
-  )\r
-;\r
+  IN OUT   EFI_BOOT_MODE     *BootMode\r
+  );\r
 \r
 /**\r
   This service enables PEIMs to update the boot mode variable.\r
@@ -537,8 +509,7 @@ EFIAPI
 PeiSetBootMode (\r
   IN CONST EFI_PEI_SERVICES  **PeiServices,\r
   IN EFI_BOOT_MODE     BootMode\r
-  )\r
-;\r
+  );\r
 \r
 //\r
 // Security support functions\r
@@ -556,11 +527,10 @@ VOID
 InitializeSecurityServices (\r
   IN EFI_PEI_SERVICES  **PeiServices,\r
   IN PEI_CORE_INSTANCE *OldCoreData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
-  Verify a Firmware volume\r
+  Verify a Firmware volume.\r
 \r
   @param CurrentFvAddress           Pointer to the current Firmware Volume under consideration\r
 \r
@@ -571,8 +541,7 @@ InitializeSecurityServices (
 EFI_STATUS\r
 VerifyFv (\r
   IN EFI_FIRMWARE_VOLUME_HEADER  *CurrentFvAddress\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -592,8 +561,7 @@ VerifyPeim (
   IN PEI_CORE_INSTANCE      *PrivateData,\r
   IN EFI_PEI_FV_HANDLE      VolumeHandle,\r
   IN EFI_PEI_FILE_HANDLE    FileHandle\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -613,8 +581,7 @@ EFIAPI
 PeiGetHobList (\r
   IN CONST EFI_PEI_SERVICES  **PeiServices,\r
   IN OUT VOID          **HobList\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Add a new HOB to the HOB List.\r
@@ -637,8 +604,7 @@ PeiCreateHob (
   IN UINT16            Type,\r
   IN UINT16            Length,\r
   IN OUT VOID          **Hob\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -656,8 +622,7 @@ PeiCoreBuildHobHandoffInfoTable (
   IN EFI_BOOT_MODE         BootMode,\r
   IN EFI_PHYSICAL_ADDRESS  MemoryBegin,\r
   IN UINT64                MemoryLength\r
-  )\r
-;\r
+  );\r
 \r
 \r
 //\r
@@ -686,8 +651,7 @@ PeiFfsFindNextFile (
   IN UINT8                       SearchType,\r
   IN EFI_PEI_FV_HANDLE           FwVolHeader,\r
   IN OUT EFI_PEI_FILE_HANDLE     *FileHeader\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Given the input file pointer, search for the next matching section in the\r
@@ -710,8 +674,7 @@ PeiFfsFindSectionData (
   IN EFI_SECTION_TYPE            SectionType,\r
   IN EFI_PEI_FILE_HANDLE         FfsFileHeader,\r
   IN OUT VOID                    **SectionData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   search the firmware volumes by index\r
@@ -730,8 +693,7 @@ PeiFvFindNextVolume (
   IN CONST EFI_PEI_SERVICES          **PeiServices,\r
   IN UINTN                           Instance,\r
   IN OUT EFI_PEI_FV_HANDLE           *FwVolHeader\r
-  )\r
-;\r
+  );\r
 \r
 //\r
 // Memory support functions\r
@@ -741,9 +703,8 @@ PeiFvFindNextVolume (
   Initialize the memory services.\r
 \r
   @param PrivateData     PeiCore's private data structure\r
-  @param SecCoreData     Points to a data structure containing information about the PEI core's operating\r
-                         environment, such as the size and location of temporary RAM, the stack location and\r
-                         the BFV location.\r
+  @param SecCoreData     Points to a data structure containing SEC to PEI handoff data, such as the size \r
+                         and location of temporary RAM, the stack location and the BFV location.\r
   @param OldCoreData     Pointer to the PEI Core data.\r
                          NULL if being run in non-permament memory mode.\r
 \r
@@ -753,8 +714,7 @@ InitializeMemoryServices (
   IN PEI_CORE_INSTANCE           *PrivateData,\r
   IN CONST EFI_SEC_PEI_HAND_OFF  *SecCoreData,\r
   IN PEI_CORE_INSTANCE           *OldCoreData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -774,8 +734,7 @@ PeiInstallPeiMemory (
   IN CONST EFI_PEI_SERVICES      **PeiServices,\r
   IN EFI_PHYSICAL_ADDRESS  MemoryBegin,\r
   IN UINT64                MemoryLength\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -802,12 +761,11 @@ PeiAllocatePages (
   IN EFI_MEMORY_TYPE            MemoryType,\r
   IN UINTN                      Pages,\r
   OUT EFI_PHYSICAL_ADDRESS      *Memory\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
-  Memory allocation service on the CAR.\r
+  Memory allocation service on the temporary memory.\r
 \r
 \r
   @param PeiServices        An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
@@ -825,8 +783,7 @@ PeiAllocatePool (
   IN CONST EFI_PEI_SERVICES           **PeiServices,\r
   IN UINTN                      Size,\r
   OUT VOID                      **Buffer\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -845,12 +802,11 @@ PeiAllocatePool (
 **/\r
 EFI_STATUS\r
 PeiLoadImage (\r
-  IN  EFI_PEI_SERVICES            **PeiServices,\r
+  IN  CONST EFI_PEI_SERVICES      **PeiServices,\r
   IN  EFI_PEI_FILE_HANDLE         FileHandle,\r
   OUT    EFI_PHYSICAL_ADDRESS     *EntryPoint,\r
   OUT    UINT32                   *AuthenticationState\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -877,8 +833,7 @@ PeiReportStatusCode (
   IN UINT32                   Instance,\r
   IN CONST EFI_GUID                 *CallerId,\r
   IN CONST EFI_STATUS_CODE_DATA     *Data OPTIONAL\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -896,8 +851,7 @@ EFI_STATUS
 EFIAPI\r
 PeiResetSystem (\r
   IN CONST EFI_PEI_SERVICES   **PeiServices\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -912,8 +866,7 @@ VOID
 PeiInitializeFv (\r
   IN  PEI_CORE_INSTANCE           *PrivateData,\r
   IN CONST EFI_SEC_PEI_HAND_OFF   *SecCoreData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Process Firmware Volum Information once FvInfoPPI install.\r
@@ -931,8 +884,7 @@ FirmwareVolmeInfoPpiNotifyCallback (
   IN EFI_PEI_SERVICES              **PeiServices,\r
   IN EFI_PEI_NOTIFY_DESCRIPTOR     *NotifyDescriptor,\r
   IN VOID                          *Ppi\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -953,8 +905,7 @@ PeiFfsFindFileByName (
   IN  CONST EFI_GUID        *FileName,\r
   IN  EFI_PEI_FV_HANDLE     VolumeHandle,\r
   OUT EFI_PEI_FILE_HANDLE   *FileHandle\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -973,8 +924,7 @@ EFIAPI
 PeiFfsGetFileInfo (\r
   IN EFI_PEI_FILE_HANDLE  FileHandle,\r
   OUT EFI_FV_FILE_INFO    *FileInfo\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
@@ -991,8 +941,7 @@ EFIAPI
 PeiFfsGetVolumeInfo (\r
   IN EFI_PEI_FV_HANDLE  VolumeHandle,\r
   OUT EFI_FV_INFO       *VolumeInfo\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   This routine enable a PEIM to register itself to shadow when PEI Foundation\r
@@ -1009,8 +958,7 @@ EFI_STATUS
 EFIAPI\r
 PeiRegisterForShadow (\r
   IN EFI_PEI_FILE_HANDLE       FileHandle\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Given the input file pointer, search for the next matching file in the\r
@@ -1036,8 +984,7 @@ PeiFindFileEx (
   IN        EFI_FV_FILETYPE          SearchType,\r
   IN OUT    EFI_PEI_FILE_HANDLE      *FileHandle,\r
   IN OUT    EFI_PEI_FV_HANDLE        *AprioriFile  OPTIONAL\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Initialize image service that install PeiLoadFilePpi.\r
@@ -1053,14 +1000,14 @@ VOID
 InitializeImageServices (\r
   IN  PEI_CORE_INSTANCE   *PrivateData,\r
   IN  PEI_CORE_INSTANCE   *OldCoreData\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.\r
 \r
   @param PeiServices          An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
-  @param FileHandle           File handle of a Fv type file.\r
+  @param ParentFvHandle       Fv handle to parent Fv image that contain this Fv file.\r
+  @param ParentFvFileHandle   File handle of a Fv type file that contain this Fv image.\r
   @param AuthenticationState  Pointer to attestation authentication state of image.\r
                               If return 0, means pass security checking.\r
 \r
@@ -1070,9 +1017,53 @@ InitializeImageServices (
 **/\r
 EFI_STATUS\r
 ProcessFvFile (\r
-  IN  EFI_PEI_SERVICES      **PeiServices,\r
-  IN  EFI_PEI_FILE_HANDLE   FvFileHandle,\r
-  OUT UINT32                *AuthenticationState\r
+  IN  CONST EFI_PEI_SERVICES **PeiServices,\r
+  IN  EFI_PEI_FV_HANDLE      ParentFvHandle,\r
+  IN  EFI_PEI_FILE_HANDLE    ParentFvFileHandle,\r
+  OUT UINT32                 *AuthenticationState\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
 #endif\r