]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add PeimDispatcherReenter to fix bug of PeiDispatch can not be quit correctly.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 12 Aug 2008 03:27:57 +0000 (03:27 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 12 Aug 2008 03:27:57 +0000 (03:27 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5628 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
MdeModulePkg/Core/Pei/PeiMain.h

index 1ea443f6ef8b25c229edbf1126299f341d677023..346398714947a8772f5884e2f16c079cece7451d 100644 (file)
@@ -335,7 +335,16 @@ 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
@@ -581,6 +590,11 @@ PeiDispatcher (
               //\r
               PrivateInMem->PeiMemoryInstalled     = TRUE;\r
 \r
+              //\r
+              // Indicate that PeiCore reenter\r
+              //\r
+              Private->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 +703,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
index c6dd03dd219c9217506d6d5cf5d21fcaafdd3479..0524d95636773a54cc4c79ba2f65b9d53f04e78c 100644 (file)
@@ -139,6 +139,7 @@ typedef struct{
   EFI_PEI_FILE_HANDLE                CurrentFileHandle;\r
   BOOLEAN                            PeimNeedingDispatch;\r
   BOOLEAN                            PeimDispatchOnThisPass;\r
+  BOOLEAN                            PeimDispatcherReenter;\r
   UINTN                              AllFvCount;\r
   EFI_PEI_FV_HANDLE                  AllFv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r
   EFI_PEI_HOB_POINTERS               HobList;\r