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