]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
Add comment for initialization value of CAR
[mirror_edk2.git] / MdeModulePkg / Core / Pei / PeiMain / PeiMain.c
index 7f7a8cf670e3c2c47856bd31de112807d0c4f0de..3b1d42e50922b1145240456d4f286a785641d098 100644 (file)
@@ -23,11 +23,6 @@ Revision History
 \r
 #include <PeiMain.h>\r
 \r
-//\r
-//CAR is filled with this initial value during SEC phase\r
-//\r
-#define INIT_CAR_VALUE 0x5AA55AA5\r
-\r
 static EFI_PEI_PPI_DESCRIPTOR mMemoryDiscoveredPpi = {\r
   (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
   &gEfiPeiMemoryDiscoveredPpiGuid,\r
@@ -122,9 +117,7 @@ Returns:
   PEI_CORE_INSTANCE                                     *OldCoreData;\r
   EFI_PEI_CPU_IO_PPI                                    *CpuIo;\r
   EFI_PEI_PCI_CFG2_PPI                                  *PciCfg;\r
-  UINT64                                                SecPlatformInfoRecordSize;\r
-  EFI_SEC_PLATFORM_INFORMATION_PPI                      *SecPlatformInfoPpi;\r
-  EFI_SEC_PLATFORM_INFORMATION_RECORD                   *SecPlatformInfoRecord;\r
+  PEI_CORE_ENTRY_POINT                                  ShadowedPeiCore;\r
 \r
   mTick = 0;\r
   OldCoreData = (PEI_CORE_INSTANCE *) Data;\r
@@ -136,6 +129,16 @@ Returns:
   }\r
 \r
   if (OldCoreData != NULL) {\r
+    ShadowedPeiCore = (PEI_CORE_ENTRY_POINT) (UINTN) OldCoreData->ShadowedPeiCore;\r
+    if (ShadowedPeiCore != NULL) {\r
+      OldCoreData->ShadowedPeiCore = NULL;\r
+      ShadowedPeiCore (\r
+        SecCoreData,\r
+        PpiList,\r
+        OldCoreData\r
+        );\r
+    }\r
+\r
     CopyMem (&PrivateData, OldCoreData, sizeof (PEI_CORE_INSTANCE));\r
     \r
     CpuIo = (VOID*)PrivateData.ServiceTableShadow.CpuIo;\r
@@ -173,34 +176,6 @@ Returns:
     PERF_END (NULL,"PreMem", NULL, 0);\r
     PERF_START (NULL,"PostMem", NULL, 0);\r
 \r
-    //\r
-    // The following code dumps out interesting cache as RAM usage information\r
-    // so we can keep tabs on how the cache as RAM is being utilized.  The\r
-    // DEBUG_CODE_BEGIN macro is used to prevent this code from being compiled\r
-    // on a debug build.\r
-    //\r
-    DEBUG_CODE_BEGIN ();\r
-      UINTN  *StackPointer;\r
-      UINTN  StackValue;\r
-\r
-      StackValue = INIT_CAR_VALUE;\r
-      for (StackPointer = (UINTN *) OldCoreData->TopOfCarHeap;\r
-           ((UINTN) StackPointer < ((UINTN) OldCoreData->MaxTopOfCarHeap))\r
-           && StackValue == INIT_CAR_VALUE;\r
-           StackPointer++) {\r
-        StackValue = *StackPointer;\r
-      }\r
-      \r
-      DEBUG ((EFI_D_INFO, "Total Cache as RAM:    %d bytes.\n", OldCoreData->SizeOfCacheAsRam));\r
-      DEBUG ((EFI_D_INFO, "  CAR stack ever used: %d bytes.\n",\r
-        ((UINTN) OldCoreData->MaxTopOfCarHeap - (UINTN) StackPointer)\r
-        ));\r
-      DEBUG ((EFI_D_INFO, "  CAR heap used:       %d bytes.\n",\r
-        ((UINTN) OldCoreData->HobList.HandoffInformationTable->EfiFreeMemoryBottom -\r
-        (UINTN) OldCoreData->HobList.Raw)\r
-        ));\r
-    DEBUG_CODE_END ();\r
-\r
     //\r
     // Alert any listeners that there is permanent memory available\r
     //\r
@@ -216,7 +191,7 @@ Returns:
     //\r
     REPORT_STATUS_CODE (\r
       EFI_PROGRESS_CODE,\r
-      EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT\r
+      FixedPcdGet32 (PcdStatusCodeValuePeiCoreEntry)\r
       );\r
 \r
     PERF_START (NULL,"PEI", NULL, mTick);\r
@@ -231,37 +206,6 @@ Returns:
     if (PpiList != NULL) {\r
       Status = PeiServicesInstallPpi (PpiList);\r
       ASSERT_EFI_ERROR (Status);\r
-      \r
-      //\r
-      // PI spec Vol 1, 7.3.1 specifies that this same information reported by EFI_SEC_PLATFORM_INFORMATION_PPI\r
-      // will be placed in a GUIDed HOB with the PPI GUID as the HOB GUID for HOB consumer phase.\r
-      //\r
-      Status = PeiServicesLocatePpi (\r
-                 &gEfiSecPlatformInformationPpiGuid,\r
-                 0,\r
-                 NULL,\r
-                 (VOID **) &SecPlatformInfoPpi\r
-                 );\r
-      if (!EFI_ERROR (Status)) {\r
-        SecPlatformInfoRecord = AllocateZeroPool (sizeof(*SecPlatformInfoRecord));\r
-        ASSERT (SecPlatformInfoRecord != NULL);\r
-\r
-        SecPlatformInfoRecordSize = sizeof(*SecPlatformInfoRecord);\r
-        \r
-        Status = SecPlatformInfoPpi->PlatformInformation (\r
-                   (CONST EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),\r
-                   &SecPlatformInfoRecordSize,\r
-                   SecPlatformInfoRecord\r
-                   );\r
-        \r
-        if (!EFI_ERROR (Status)) {\r
-          BuildGuidDataHob (\r
-            &gEfiSecPlatformInformationPpiGuid,\r
-            SecPlatformInfoRecord,\r
-            sizeof (*SecPlatformInfoRecord)\r
-            );\r
-        }\r
-      }\r
     }\r
   }\r
 \r