summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-12 03:27:57 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-12 03:27:57 +0000
commit1bd90a4c479759542f86dbac953855552cbb31fa (patch)
tree1f885d3e78503d5e8f20accd62efd308b0d1692a /MdeModulePkg
parentd949491623f84f8151275438c41afc92698f000c (diff)
downloadedk2-platforms-1bd90a4c479759542f86dbac953855552cbb31fa.tar.xz
Add PeimDispatcherReenter to fix bug of PeiDispatch can not be quit correctly.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5628 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c19
-rw-r--r--MdeModulePkg/Core/Pei/PeiMain.h1
2 files changed, 17 insertions, 3 deletions
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 1ea443f6ef..3463987149 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -335,7 +335,16 @@ PeiDispatcher (
// satisfied, this dipatcher should run only once.
//
do {
-
+ //
+ // In case that reenter PeiCore happens, the last pass record is still available.
+ //
+ if (!Private->PeimDispatcherReenter) {
+ Private->PeimNeedingDispatch = FALSE;
+ Private->PeimDispatchOnThisPass = FALSE;
+ } else {
+ Private->PeimDispatcherReenter = FALSE;
+ }
+
for (FvCount = Private->CurrentPeimFvCount; FvCount < Private->FvCount; FvCount++) {
Private->CurrentPeimFvCount = FvCount;
VolumeHandle = Private->Fv[FvCount].FvHeader;
@@ -582,6 +591,11 @@ PeiDispatcher (
PrivateInMem->PeiMemoryInstalled = TRUE;
//
+ // Indicate that PeiCore reenter
+ //
+ Private->PeimDispatcherReenter = TRUE;
+
+ //
// Shadow PEI Core. When permanent memory is avaiable, shadow
// PEI Core and PEIMs to get high performance.
//
@@ -689,8 +703,7 @@ InitializeDispatcherData (
)
{
if (OldCoreData == NULL) {
- PrivateData->PeimNeedingDispatch = FALSE;
- PrivateData->PeimDispatchOnThisPass = FALSE;
+ PrivateData->PeimDispatcherReenter = FALSE;
PeiInitializeFv (PrivateData, SecCoreData);
}
diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h
index c6dd03dd21..0524d95636 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.h
+++ b/MdeModulePkg/Core/Pei/PeiMain.h
@@ -139,6 +139,7 @@ typedef struct{
EFI_PEI_FILE_HANDLE CurrentFileHandle;
BOOLEAN PeimNeedingDispatch;
BOOLEAN PeimDispatchOnThisPass;
+ BOOLEAN PeimDispatcherReenter;
UINTN AllFvCount;
EFI_PEI_FV_HANDLE AllFv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];
EFI_PEI_HOB_POINTERS HobList;