]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
Add compatibility logic to handle framework fvhob and install FvInfo ppi. And remove...
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Dispatcher / Dispatcher.c
index 1ea443f6ef8b25c229edbf1126299f341d677023..b83f0006e4c0455ec69e3631e4c4491bda8e4b30 100644 (file)
@@ -335,10 +335,22 @@ PeiDispatcher (
   // satisfied, this dipatcher should run only once.\r
   //\r
   do {\r
-\r
+    //\r
+    // In case that reenter PeiCore happens, the last pass record is still available.   \r
+    //\r
+    if (!Private->PeimDispatcherReenter) {\r
+      Private->PeimNeedingDispatch      = FALSE;\r
+      Private->PeimDispatchOnThisPass   = FALSE;\r
+    } else {\r
+      Private->PeimDispatcherReenter    = FALSE;\r
+    }\r
+    \r
     for (FvCount = Private->CurrentPeimFvCount; FvCount < Private->FvCount; FvCount++) {\r
       Private->CurrentPeimFvCount = FvCount;\r
-      VolumeHandle = Private->Fv[FvCount].FvHeader;\r
+      //\r
+      // Get this Fv Handle by PeiService FvFindNextVolume.\r
+      //\r
+      PeiFvFindNextVolume (PeiServices, FvCount, &VolumeHandle);\r
 \r
       if (Private->CurrentPeimCount == 0) {\r
         //\r
@@ -581,6 +593,11 @@ PeiDispatcher (
               //\r
               PrivateInMem->PeiMemoryInstalled     = TRUE;\r
 \r
+              //\r
+              // Indicate that PeiCore reenter\r
+              //\r
+              PrivateInMem->PeimDispatcherReenter  = TRUE;\r
+              \r
               //\r
               // Shadow PEI Core. When permanent memory is avaiable, shadow\r
               // PEI Core and PEIMs to get high performance.\r
@@ -689,8 +706,7 @@ InitializeDispatcherData (
   )\r
 {\r
   if (OldCoreData == NULL) {\r
-    PrivateData->PeimNeedingDispatch    = FALSE;\r
-    PrivateData->PeimDispatchOnThisPass = FALSE;\r
+    PrivateData->PeimDispatcherReenter = FALSE;\r
     PeiInitializeFv (PrivateData, SecCoreData);\r
   }\r
 \r