summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-11 08:13:21 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-11 08:13:21 +0000
commit1762b989dcd67b567a8e4ed9067cbaf6253d8c9c (patch)
treeaf9b47cbc5f2147ed63045be1d005e9b1c282601 /MdeModulePkg
parentb2821d6b646488e49d7a741891a38c2985e0a1ec (diff)
downloadedk2-platforms-1762b989dcd67b567a8e4ed9067cbaf6253d8c9c.tar.xz
Enhance PeiCore's dispatcher, move PeimDispatchOnThisPass and PeimNeedingDispatch to private data to hold status for PeiCore's second reenter.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5626 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c17
-rw-r--r--MdeModulePkg/Core/Pei/PeiMain.h2
2 files changed, 7 insertions, 12 deletions
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 9c1aab916f..9e0160cc86 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -247,8 +247,6 @@ PeiDispatcher (
UINT32 AuthenticationState;
EFI_PHYSICAL_ADDRESS EntryPoint;
EFI_PEIM_ENTRY_POINT2 PeimEntryPoint;
- BOOLEAN PeimNeedingDispatch;
- BOOLEAN PeimDispatchOnThisPass;
UINTN SaveCurrentPeimCount;
UINTN SaveCurrentFvCount;
EFI_PEI_FILE_HANDLE SaveCurrentFileHandle;
@@ -332,8 +330,6 @@ PeiDispatcher (
// satisfied, this dipatcher should run only once.
//
do {
- PeimNeedingDispatch = FALSE;
- PeimDispatchOnThisPass = FALSE;
for (FvCount = Private->CurrentPeimFvCount; FvCount < Private->FvCount; FvCount++) {
Private->CurrentPeimFvCount = FvCount;
@@ -359,7 +355,7 @@ PeiDispatcher (
if (Private->Fv[FvCount].PeimState[PeimCount] == PEIM_STATE_NOT_DISPATCHED) {
if (!DepexSatisfied (Private, PeimFileHandle, PeimCount)) {
- PeimNeedingDispatch = TRUE;
+ Private->PeimNeedingDispatch = TRUE;
} else {
Status = PeiFfsGetFileInfo (PeimFileHandle, &FvFileInfo);
ASSERT_EFI_ERROR (Status);
@@ -411,7 +407,7 @@ PeiDispatcher (
PeimEntryPoint (PeimFileHandle, (const EFI_PEI_SERVICES **) PeiServices);
}
- PeimDispatchOnThisPass = TRUE;
+ Private->PeimDispatchOnThisPass = TRUE;
}
REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
@@ -581,11 +577,6 @@ PeiDispatcher (
PrivateInMem->PeiMemoryInstalled = TRUE;
//
- // Restart scan of all PEIMs on next pass
- //
- PrivateInMem->CurrentPeimCount = 0;
-
- //
// Shadow PEI Core. When permanent memory is avaiable, shadow
// PEI Core and PEIMs to get high performance.
//
@@ -668,7 +659,7 @@ PeiDispatcher (
// pass. If we did not dispatch a PEIM there is no point in trying again
// as it will fail the next time too (nothing has changed).
//
- } while (PeimNeedingDispatch && PeimDispatchOnThisPass);
+ } while (Private->PeimNeedingDispatch && Private->PeimDispatchOnThisPass);
}
@@ -693,6 +684,8 @@ InitializeDispatcherData (
)
{
if (OldCoreData == NULL) {
+ PrivateData->PeimNeedingDispatch = FALSE;
+ PrivateData->PeimDispatchOnThisPass = FALSE;
PeiInitializeFv (PrivateData, SecCoreData);
}
diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h
index e121fa4281..c6dd03dd21 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.h
+++ b/MdeModulePkg/Core/Pei/PeiMain.h
@@ -137,6 +137,8 @@ typedef struct{
UINTN CurrentPeimFvCount;
UINTN CurrentPeimCount;
EFI_PEI_FILE_HANDLE CurrentFileHandle;
+ BOOLEAN PeimNeedingDispatch;
+ BOOLEAN PeimDispatchOnThisPass;
UINTN AllFvCount;
EFI_PEI_FV_HANDLE AllFv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];
EFI_PEI_HOB_POINTERS HobList;