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
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
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
// 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
#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
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
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