]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Enhance PeiCore's dispatcher, move PeimDispatchOnThisPass and PeimNeedingDispatch...
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 11 Aug 2008 08:13:21 +0000 (08:13 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 11 Aug 2008 08:13:21 +0000 (08:13 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5626 6f19259b-4bc3-4df7-8a09-765794883524

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

index 9c1aab916f693443a75ef9e31781f7ba01700738..9e0160cc866ca440278ca50c96b6bfffda0a0b25 100644 (file)
@@ -247,8 +247,6 @@ PeiDispatcher (
   UINT32                              AuthenticationState;\r
   EFI_PHYSICAL_ADDRESS                EntryPoint;\r
   EFI_PEIM_ENTRY_POINT2               PeimEntryPoint;\r
-  BOOLEAN                             PeimNeedingDispatch;\r
-  BOOLEAN                             PeimDispatchOnThisPass;\r
   UINTN                               SaveCurrentPeimCount;\r
   UINTN                               SaveCurrentFvCount;\r
   EFI_PEI_FILE_HANDLE                 SaveCurrentFileHandle;\r
@@ -332,8 +330,6 @@ PeiDispatcher (
   // satisfied, this dipatcher should run only once.\r
   //\r
   do {\r
-    PeimNeedingDispatch = FALSE;\r
-    PeimDispatchOnThisPass = FALSE;\r
 \r
     for (FvCount = Private->CurrentPeimFvCount; FvCount < Private->FvCount; FvCount++) {\r
       Private->CurrentPeimFvCount = FvCount;\r
@@ -359,7 +355,7 @@ PeiDispatcher (
 \r
         if (Private->Fv[FvCount].PeimState[PeimCount] == PEIM_STATE_NOT_DISPATCHED) {\r
           if (!DepexSatisfied (Private, PeimFileHandle, PeimCount)) {\r
-            PeimNeedingDispatch = TRUE;\r
+            Private->PeimNeedingDispatch = TRUE;\r
           } else {\r
             Status = PeiFfsGetFileInfo (PeimFileHandle, &FvFileInfo);\r
             ASSERT_EFI_ERROR (Status);\r
@@ -411,7 +407,7 @@ PeiDispatcher (
                   PeimEntryPoint (PeimFileHandle, (const EFI_PEI_SERVICES **) PeiServices);\r
                 }\r
 \r
-                PeimDispatchOnThisPass = TRUE;\r
+                Private->PeimDispatchOnThisPass = TRUE;\r
               }\r
 \r
               REPORT_STATUS_CODE_WITH_EXTENDED_DATA (\r
@@ -580,11 +576,6 @@ PeiDispatcher (
               //\r
               PrivateInMem->PeiMemoryInstalled     = TRUE;\r
 \r
-              //\r
-              // Restart scan of all PEIMs on next pass\r
-              //\r
-              PrivateInMem->CurrentPeimCount = 0;\r
-\r
               //\r
               // Shadow PEI Core. When permanent memory is avaiable, shadow\r
               // PEI Core and PEIMs to get high performance.\r
@@ -668,7 +659,7 @@ PeiDispatcher (
     //  pass. If we did not dispatch a PEIM there is no point in trying again\r
     //  as it will fail the next time too (nothing has changed).\r
     //\r
-  } while (PeimNeedingDispatch && PeimDispatchOnThisPass);\r
+  } while (Private->PeimNeedingDispatch && Private->PeimDispatchOnThisPass);\r
 \r
 }\r
 \r
@@ -693,6 +684,8 @@ InitializeDispatcherData (
   )\r
 {\r
   if (OldCoreData == NULL) {\r
+    PrivateData->PeimNeedingDispatch    = FALSE;\r
+    PrivateData->PeimDispatchOnThisPass = FALSE;\r
     PeiInitializeFv (PrivateData, SecCoreData);\r
   }\r
 \r
index e121fa4281986bb025463a0104b4d557d86eebe6..c6dd03dd219c9217506d6d5cf5d21fcaafdd3479 100644 (file)
@@ -137,6 +137,8 @@ typedef struct{
   UINTN                              CurrentPeimFvCount;\r
   UINTN                              CurrentPeimCount;\r
   EFI_PEI_FILE_HANDLE                CurrentFileHandle;\r
+  BOOLEAN                            PeimNeedingDispatch;\r
+  BOOLEAN                            PeimDispatchOnThisPass;\r
   UINTN                              AllFvCount;\r
   EFI_PEI_FV_HANDLE                  AllFv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r
   EFI_PEI_HOB_POINTERS               HobList;\r