summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core/Pei/PeiMain.h
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Core/Pei/PeiMain.h')
-rw-r--r--MdeModulePkg/Core/Pei/PeiMain.h75
1 files changed, 38 insertions, 37 deletions
diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h
index c37bc12..205776c 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.h
+++ b/MdeModulePkg/Core/Pei/PeiMain.h
@@ -128,13 +128,39 @@ typedef struct {
UINTN SectionIndex;
} CACHE_SECTION_DATA;
+///
+/// Forward declaration for PEI_CORE_INSTANCE
+///
+typedef struct _PEI_CORE_INSTANCE PEI_CORE_INSTANCE;
+
+
+/**
+ Function Pointer type for PeiCore function.
+ @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
+ and location of temporary RAM, the stack location and the BFV location.
+ @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
+ An empty PPI list consists of a single descriptor with the end-tag
+ EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization
+ phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such
+ that both the PEI Foundation and any modules can leverage the associated service
+ calls and/or code in these early PPIs
+ @param OldCoreData Pointer to old core data that is used to initialize the
+ core's data areas.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *PEICORE_FUNCTION_POINTER)(
+ IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
+ IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList,
+ IN PEI_CORE_INSTANCE *OldCoreData
+ );
#define PEI_CORE_HANDLE_SIGNATURE SIGNATURE_32('P','e','i','C')
///
/// Pei Core private data structure instance
///
-typedef struct{
+struct _PEI_CORE_INSTANCE {
UINTN Signature;
///
@@ -166,8 +192,6 @@ typedef struct{
EFI_PEI_HOB_POINTERS HobList;
BOOLEAN SwitchStackSignal;
BOOLEAN PeiMemoryInstalled;
- EFI_PHYSICAL_ADDRESS StackBase;
- UINT64 StackSize;
VOID *CpuIo;
EFI_PEI_SECURITY2_PPI *PrivateSecurityPpi;
EFI_PEI_SERVICES ServiceTableShadow;
@@ -175,7 +199,11 @@ typedef struct{
EFI_PHYSICAL_ADDRESS PhysicalMemoryBegin;
UINT64 PhysicalMemoryLength;
EFI_PHYSICAL_ADDRESS FreePhysicalMemoryTop;
- VOID* ShadowedPeiCore;
+ UINTN HeapOffset;
+ BOOLEAN HeapOffsetPositive;
+ UINTN StackOffset;
+ BOOLEAN StackOffsetPositive;
+ PEICORE_FUNCTION_POINTER ShadowedPeiCore;
CACHE_SECTION_DATA CacheSection;
//
// For Loading modules at fixed address feature to cache the top address below which the
@@ -193,7 +221,7 @@ typedef struct{
// This field points to the shadowed image read function
//
PE_COFF_LOADER_READ_FILE ShadowedImageRead;
-} PEI_CORE_INSTANCE;
+};
///
/// Pei Core Instance Data Macros
@@ -201,27 +229,6 @@ typedef struct{
#define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
CR(a, PEI_CORE_INSTANCE, Ps, PEI_CORE_HANDLE_SIGNATURE)
-/**
- Function Pointer type for PeiCore function.
- @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
- and location of temporary RAM, the stack location and the BFV location.
- @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
- An empty PPI list consists of a single descriptor with the end-tag
- EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization
- phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such
- that both the PEI Foundation and any modules can leverage the associated service
- calls and/or code in these early PPIs
- @param OldCoreData Pointer to old core data that is used to initialize the
- core's data areas.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *PEICORE_FUNCTION_POINTER)(
- IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
- IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList,
- IN PEI_CORE_INSTANCE *OldCoreData
- );
-
///
/// Union of temporarily used function pointers (to save stack space)
///
@@ -373,21 +380,15 @@ InitializePpiServices (
Migrate the Hob list from the temporary memory stack to PEI installed memory.
- @param PrivateData Pointer to PeiCore's private data structure.
- @param OldCheckingBottom Bottom of temporary memory range. All Ppi in this range
- will be fixup for PpiData and PpiDescriptor pointer.
- @param OldCheckingTop Top of temporary memory range. All Ppi in this range
- will be fixup for PpiData and PpiDescriptor.
- @param Fixup The address difference between
- the new Hob list and old Hob list.
+ @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
+ and location of temporary RAM, the stack location and the BFV location.
+ @param PrivateData Pointer to PeiCore's private data structure.
**/
VOID
ConvertPpiPointers (
- IN PEI_CORE_INSTANCE *PrivateData,
- IN UINTN OldCheckingBottom,
- IN UINTN OldCheckingTop,
- IN INTN Fixup
+ IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
+ IN PEI_CORE_INSTANCE *PrivateData
);
/**