]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/PeiMain.h
Use two PCDs to replace _DISABLE_UNUSED_HII_PROTOCOLS_ macro.
[mirror_edk2.git] / MdeModulePkg / Core / Pei / PeiMain.h
index ef2d592a5e51bcd6b92f1e41d23028672146cbb3..ca48a51fbd8698da4cd67cf50fc1e2c4342877bf 100644 (file)
@@ -1,4 +1,4 @@
-/*++\r
+/** @file\r
 \r
 Copyright (c) 2006 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -19,7 +19,7 @@ Abstract:
 \r
 Revision History\r
 \r
---*/\r
+**/\r
 \r
 #ifndef _PEI_MAIN_H_\r
 #define _PEI_MAIN_H_\r
@@ -35,6 +35,7 @@ Revision History
 #include <Ppi/GuidedSectionExtraction.h>\r
 #include <Ppi/LoadFile.h>\r
 #include <Ppi/Security2.h>\r
+#include <Ppi/TemporaryRamSupport.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/PeiCoreEntryPoint.h>\r
 #include <Library/BaseLib.h>\r
@@ -66,17 +67,13 @@ typedef union {
   VOID                        *Raw;\r
 } PEI_PPI_LIST_POINTERS;\r
 \r
-#define PEI_STACK_SIZE 0x20000\r
-\r
-#define MAX_PPI_DESCRIPTORS 128\r
-\r
 typedef struct {\r
   INTN                    PpiListEnd;\r
   INTN                    NotifyListEnd;\r
   INTN                    DispatchListEnd;\r
   INTN                    LastDispatchedInstall;\r
   INTN                    LastDispatchedNotify;\r
-  PEI_PPI_LIST_POINTERS   PpiListPtrs[MAX_PPI_DESCRIPTORS];\r
+  PEI_PPI_LIST_POINTERS   PpiListPtrs[FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)];\r
 } PEI_PPI_DATABASE;\r
 \r
 \r
@@ -135,9 +132,14 @@ typedef struct{
   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
+  EFI_PHYSICAL_ADDRESS               FreePhysicalMemoryTop;\r
+  VOID*                              ShadowedPeiCore;\r
   CACHE_SECTION_DATA                 CacheSection;\r
 } PEI_CORE_INSTANCE;\r
 \r
@@ -307,6 +309,35 @@ Returns:
 ;\r
 \r
 \r
+EFI_STATUS\r
+FindNextPeim (\r
+  IN EFI_PEI_SERVICES            **PeiServices,\r
+  IN EFI_FIRMWARE_VOLUME_HEADER  *FwVolHeader,\r
+  IN OUT EFI_FFS_FILE_HEADER     **PeimFileHeader\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+    Given the input file pointer, search for the next matching file in the\r
+    FFS volume. The search starts from FileHeader inside\r
+    the Firmware Volume defined by FwVolHeader.\r
+\r
+Arguments:\r
+    PeiServices - Pointer to the PEI Core Services Table.\r
+\r
+    FwVolHeader - Pointer to the FV header of the volume to search.\r
+                     This parameter must point to a valid FFS volume.\r
+\r
+    PeimFileHeader  - Pointer to the current file from which to begin searching.\r
+                  This pointer will be updated upon return to reflect the file found.\r
+\r
+Returns:\r
+    EFI_NOT_FOUND - No files matching the search criteria were found\r
+    EFI_SUCCESS\r
+\r
+--*/\r
+;\r
+\r
 BOOLEAN\r
 Dispatched (\r
   IN UINT8  CurrentPeim,\r
@@ -379,38 +410,6 @@ Returns:
 --*/\r
 ;\r
 \r
-#if   defined (MDE_CPU_IPF)\r
-  //\r
-  // In Ipf we should make special changes for the PHIT pointers to support\r
-  // recovery boot in cache mode.\r
-  //\r
-#define  SWITCH_TO_CACHE_MODE(CoreData)  SwitchToCacheMode(CoreData)\r
-#define  CACHE_MODE_ADDRESS_MASK         0x7FFFFFFFFFFFFFFFULL\r
-VOID\r
-SwitchToCacheMode (\r
-  IN PEI_CORE_INSTANCE           *CoreData\r
-)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR.\r
-\r
-Arguments:\r
-\r
-  CoreData   - The PEI core Private Data\r
-\r
-Returns:\r
-\r
---*/\r
-;\r
-\r
-#else\r
-\r
-#define  SWITCH_TO_CACHE_MODE(CoreData)\r
-\r
-#endif\r
-\r
 //\r
 // PPI support functions\r
 //\r
@@ -439,8 +438,9 @@ Returns:
 \r
 VOID\r
 ConvertPpiPointers (\r
-  IN CONST EFI_PEI_SERVICES              **PeiServices,\r
-  IN EFI_HOB_HANDOFF_INFO_TABLE    *OldHandOffHob,\r
+  IN CONST EFI_PEI_SERVICES                     **PeiServices,\r
+  IN UINTN                         OldCheckingBottom,\r
+  IN UINTN                         OldCheckingTop,\r
   IN EFI_HOB_HANDOFF_INFO_TABLE    *NewHandOffHob\r
   )\r
 /*++\r
@@ -451,9 +451,10 @@ Routine Description:
 \r
 Arguments:\r
 \r
-  PeiServices   - The PEI core services table.\r
-  OldHandOffHob - The old handoff HOB list.\r
-  NewHandOffHob - The new handoff HOB list.\r
+  PeiServices       - The PEI core services table.\r
+  OldCheckingBottom - The old checking bottom.\r
+  OldCheckingTop    - The old checking top.\r
+  NewHandOffHob     - The new handoff HOB list.\r
 \r
 Returns:\r
 \r
@@ -1301,38 +1302,6 @@ PeiRegisterForShadow (
   )\r
 ;\r
 \r
-/**\r
-  Transfers control to a function starting with a new stack.\r
-\r
-  Transfers control to the function specified by EntryPoint using the new stack\r
-  specified by NewStack and passing in the parameters specified by Context1 and\r
-  Context2. Context1 and Context2 are optional and may be NULL. The function\r
-  EntryPoint must never return.\r
-\r
-  If EntryPoint is NULL, then ASSERT().\r
-  If NewStack is NULL, then ASSERT().\r
-\r
-  @param  EntryPoint  A pointer to function to call with the new stack.\r
-  @param  Context1    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  Context2    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
-                      function.\r
-  @param  NewBsp      A pointer to the new BSP for the EntryPoint on IPF. It's\r
-                      Reserved on other architectures.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-PeiSwitchStacks (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *NewStack,\r
-  IN      VOID                      *NewBsp\r
-  );\r
-\r
 EFI_STATUS\r
 PeiFindFileEx (\r
   IN  CONST EFI_PEI_FV_HANDLE        FvHandle,\r