]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
Temporarily rollback the change from 5625 though 5628 for more investigation.
[mirror_edk2.git] / MdeModulePkg / Core / Pei / PeiMain / PeiMain.c
index 6e032783d0bdd88142cd5d52be38993a54b47647..d257eaee432db9bd8d41151dd50a58b9f2d63fe0 100644 (file)
@@ -21,7 +21,8 @@ STATIC EFI_PEI_PPI_DESCRIPTOR mMemoryDiscoveredPpi = {
 };\r
 \r
 ///\r
-/// Pei service instance\r
+/// Pei Core Module Variables\r
+///\r
 ///\r
 STATIC EFI_PEI_SERVICES  gPs = {\r
   {\r
@@ -66,10 +67,11 @@ STATIC EFI_PEI_SERVICES  gPs = {
 \r
 /**\r
 \r
-  This routine is invoked by main entry of PeiMain module during transition\r
+  The entry routine to Pei Core, invoked by PeiMain during transition\r
   from SEC to PEI. After switching stack in the PEI core, it will restart\r
   with the old core data.\r
 \r
+\r
   @param SecCoreData     Points to a data structure containing information about the PEI core's operating\r
                          environment, such as the size and location of temporary RAM, the stack location and\r
                          the BFV location.\r
@@ -81,7 +83,6 @@ STATIC EFI_PEI_SERVICES  gPs = {
                          calls and/or code in these early PPIs\r
   @param Data            Pointer to old core data that is used to initialize the\r
                          core's data areas.\r
-                         If NULL, it is first PeiCore entering.\r
 \r
   @retval EFI_NOT_FOUND  Never reach\r
 \r
@@ -97,13 +98,13 @@ PeiCore (
   PEI_CORE_INSTANCE                                     PrivateData;\r
   EFI_STATUS                                            Status;\r
   PEI_CORE_TEMP_POINTERS                                TempPtr;\r
-  UINT64                                                Tick;\r
+  UINT64                                                mTick;\r
   PEI_CORE_INSTANCE                                     *OldCoreData;\r
   EFI_PEI_CPU_IO_PPI                                    *CpuIo;\r
   EFI_PEI_PCI_CFG2_PPI                                  *PciCfg;\r
   PEICORE_FUNCTION_POINTER                              ShadowedPeiCore;\r
 \r
-  Tick = 0;\r
+  mTick = 0;\r
   OldCoreData = (PEI_CORE_INSTANCE *) Data;\r
 \r
   //\r
@@ -112,17 +113,16 @@ PeiCore (
   // \r
   if (PerformanceMeasurementEnabled()) {\r
     if (OldCoreData == NULL) {\r
-      Tick = GetPerformanceCounter ();\r
+      mTick = GetPerformanceCounter ();\r
     }\r
   }\r
 \r
+  //\r
+  // PeiCore has been shadowed to memory for first entering, so\r
+  // just jump to PeiCore in memory here.\r
+  //\r
   if (OldCoreData != NULL) {\r
     ShadowedPeiCore = (PEICORE_FUNCTION_POINTER) (UINTN) OldCoreData->ShadowedPeiCore;\r
-    \r
-    //\r
-    // PeiCore has been shadowed to memory for first entering, so\r
-    // just jump to PeiCore in memory here.\r
-    //\r
     if (ShadowedPeiCore != NULL) {\r
       OldCoreData->ShadowedPeiCore = NULL;\r
       ShadowedPeiCore (\r
@@ -142,10 +142,6 @@ PeiCore (
     PrivateData.ServiceTableShadow.CpuIo  = CpuIo;\r
     PrivateData.ServiceTableShadow.PciCfg = PciCfg;\r
   } else {\r
-    //\r
-    // If OldCoreData is NULL, means current is first Peicore's entering.\r
-    //\r
-    \r
     ZeroMem (&PrivateData, sizeof (PEI_CORE_INSTANCE));\r
     PrivateData.Signature = PEI_CORE_HANDLE_SIGNATURE;\r
     CopyMem (&PrivateData.ServiceTableShadow, &gPs, sizeof (gPs));\r
@@ -190,11 +186,11 @@ PeiCore (
       FixedPcdGet32 (PcdStatusCodeValuePeiCoreEntry)\r
       );\r
 \r
-    PERF_START (NULL,"PEI", NULL, Tick);\r
+    PERF_START (NULL,"PEI", NULL, mTick);\r
     //\r
     // If first pass, start performance measurement.\r
     //\r
-    PERF_START (NULL,"PreMem", NULL, Tick);\r
+    PERF_START (NULL,"PreMem", NULL, mTick);\r
 \r
     //\r
     // If SEC provided any PPI services to PEI, install them.\r