// 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
//\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
)\r
{\r
if (OldCoreData == NULL) {\r
- PrivateData->PeimNeedingDispatch = FALSE;\r
- PrivateData->PeimDispatchOnThisPass = FALSE;\r
+ PrivateData->PeimDispatcherReenter = FALSE;\r
PeiInitializeFv (PrivateData, SecCoreData);\r
}\r
\r