]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
MdeModulePkg: Update PeiCore consumes PCD to get the init value in temp stack
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Dispatcher / Dispatcher.c
index 04ece9a627d5d2603279d93182c18760b0ade61e..467066a0bf1beb3f5914d32eec6468932fe2d833 100644 (file)
@@ -15,11 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "PeiMain.h"\r
 \r
-///\r
-/// temporary memory is filled with this initial value during SEC phase\r
-///\r
-#define INIT_CAR_VALUE 0x5AA55AA5\r
-\r
 /**\r
 \r
   Discover all Peims and optional Apriori file in one FV. There is at most one\r
@@ -675,11 +670,12 @@ PeiCheckAndSwitchStack (
     // usage in temporary memory for debugging.\r
     //\r
     DEBUG_CODE_BEGIN ();\r
-      UINT32  *StackPointer;\r
+      UINT32                *StackPointer;\r
+      EFI_PEI_HOB_POINTERS  Hob;\r
 \r
       for (StackPointer = (UINT32*)SecCoreData->StackBase;\r
            (StackPointer < (UINT32*)((UINTN)SecCoreData->StackBase + SecCoreData->StackSize)) \\r
-           && (*StackPointer == INIT_CAR_VALUE);\r
+           && (*StackPointer == PcdGet32 (PcdInitValueInTempStack));\r
            StackPointer ++);\r
 \r
       DEBUG ((DEBUG_INFO, "Temp Stack : BaseAddress=0x%p Length=0x%X\n", SecCoreData->StackBase, (UINT32)SecCoreData->StackSize));\r
@@ -691,6 +687,17 @@ PeiCheckAndSwitchStack (
       DEBUG ((DEBUG_INFO, "  temporary memory heap used for HobList: %d bytes.\n",\r
              (UINT32)((UINTN)Private->HobList.HandoffInformationTable->EfiFreeMemoryBottom - (UINTN)Private->HobList.Raw)\r
             ));\r
+      DEBUG ((DEBUG_INFO, "  temporary memory heap occupied by memory pages: %d bytes.\n",\r
+             (UINT32)(UINTN)(Private->HobList.HandoffInformationTable->EfiMemoryTop - Private->HobList.HandoffInformationTable->EfiFreeMemoryTop)\r
+            ));\r
+      for (Hob.Raw = Private->HobList.Raw; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {\r
+        if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_MEMORY_ALLOCATION) {\r
+          DEBUG ((DEBUG_INFO, "Memory Allocation 0x%08x 0x%0lx - 0x%0lx\n", \\r
+            Hob.MemoryAllocation->AllocDescriptor.MemoryType,               \\r
+            Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress,        \\r
+            Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress + Hob.MemoryAllocation->AllocDescriptor.MemoryLength - 1));\r
+        }\r
+      }\r
     DEBUG_CODE_END ();\r
 \r
     if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0 && (Private->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME)) {\r