]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/PeiMain.h
Patch from open source community for CryptoPkg to allow it to build for ARM using...
[mirror_edk2.git] / MdeModulePkg / Core / Pei / PeiMain.h
index 1bb1103b7382fcfc6135a748256ce3578996b7b9..fbfe4f59da9935f2e03305c796b359253e28c665 100644 (file)
@@ -128,13 +128,39 @@ typedef struct {
   UINTN                               SectionIndex;\r
 } CACHE_SECTION_DATA;\r
 \r
+///\r
+/// Forward declaration for PEI_CORE_INSTANCE\r
+///\r
+typedef struct _PEI_CORE_INSTANCE  PEI_CORE_INSTANCE;\r
+\r
+\r
+/**\r
+  Function Pointer type for PeiCore function.\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 OldCoreData     Pointer to old core data that is used to initialize the\r
+                         core's data areas.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PEICORE_FUNCTION_POINTER)(\r
+  IN CONST  EFI_SEC_PEI_HAND_OFF    *SecCoreData,\r
+  IN CONST  EFI_PEI_PPI_DESCRIPTOR  *PpiList,\r
+  IN PEI_CORE_INSTANCE              *OldCoreData\r
+  );\r
 \r
 #define PEI_CORE_HANDLE_SIGNATURE  SIGNATURE_32('P','e','i','C')\r
 \r
 ///\r
 /// Pei Core private data structure instance\r
 ///\r
-typedef struct{\r
+struct _PEI_CORE_INSTANCE {\r
   UINTN                              Signature;\r
   \r
   ///\r
@@ -166,8 +192,6 @@ typedef struct{
   EFI_PEI_HOB_POINTERS               HobList;\r
   BOOLEAN                            SwitchStackSignal;\r
   BOOLEAN                            PeiMemoryInstalled;\r
-  EFI_PHYSICAL_ADDRESS               StackBase;\r
-  UINT64                             StackSize;\r
   VOID                               *CpuIo;\r
   EFI_PEI_SECURITY2_PPI              *PrivateSecurityPpi;\r
   EFI_PEI_SERVICES                   ServiceTableShadow;\r
@@ -175,7 +199,9 @@ typedef struct{
   EFI_PHYSICAL_ADDRESS               PhysicalMemoryBegin;\r
   UINT64                             PhysicalMemoryLength;\r
   EFI_PHYSICAL_ADDRESS               FreePhysicalMemoryTop;\r
-  VOID*                              ShadowedPeiCore;\r
+  UINTN                              HeapOffset;\r
+  BOOLEAN                            HeapOffsetPositive;\r
+  PEICORE_FUNCTION_POINTER           ShadowedPeiCore;\r
   CACHE_SECTION_DATA                 CacheSection;\r
   //\r
   // For Loading modules at fixed address feature to cache the top address below which the \r
@@ -193,7 +219,7 @@ typedef struct{
   // This field points to the shadowed image read function\r
   //\r
   PE_COFF_LOADER_READ_FILE          ShadowedImageRead;\r
-} PEI_CORE_INSTANCE;\r
+};\r
 \r
 ///\r
 /// Pei Core Instance Data Macros\r
@@ -201,27 +227,6 @@ typedef struct{
 #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \\r
   CR(a, PEI_CORE_INSTANCE, Ps, PEI_CORE_HANDLE_SIGNATURE)\r
 \r
-/**\r
-  Function Pointer type for PeiCore function.\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 OldCoreData     Pointer to old core data that is used to initialize the\r
-                         core's data areas.\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *PEICORE_FUNCTION_POINTER)(\r
-  IN CONST  EFI_SEC_PEI_HAND_OFF    *SecCoreData,\r
-  IN CONST  EFI_PEI_PPI_DESCRIPTOR  *PpiList,\r
-  IN PEI_CORE_INSTANCE              *OldCoreData\r
-  );\r
-\r
 ///\r
 /// Union of temporarily used function pointers (to save stack space)\r
 ///\r
@@ -380,6 +385,8 @@ InitializePpiServices (
                              will be fixup for PpiData and PpiDescriptor.\r
   @param Fixup               The address difference between\r
                              the new Hob list and old Hob list.\r
+  @param FixupPositive       TRUE if new Hob list is above the old Hob list.  \r
+                             Otherwise FALSE.\r
 \r
 **/\r
 VOID\r
@@ -387,7 +394,8 @@ ConvertPpiPointers (
   IN PEI_CORE_INSTANCE       *PrivateData,\r
   IN UINTN                   OldCheckingBottom,\r
   IN UINTN                   OldCheckingTop,\r
-  IN INTN                    Fixup\r
+  IN UINTN                   Fixup,\r
+  IN BOOLEAN                 FixupPositive\r
   );\r
 \r
 /**\r