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
This commit is contained in:
klu2 2008-08-11 08:13:21 +00:00
parent b2821d6b64
commit 1762b989dc
2 changed files with 7 additions and 12 deletions

View File

@ -247,8 +247,6 @@ PeiDispatcher (
UINT32 AuthenticationState; UINT32 AuthenticationState;
EFI_PHYSICAL_ADDRESS EntryPoint; EFI_PHYSICAL_ADDRESS EntryPoint;
EFI_PEIM_ENTRY_POINT2 PeimEntryPoint; EFI_PEIM_ENTRY_POINT2 PeimEntryPoint;
BOOLEAN PeimNeedingDispatch;
BOOLEAN PeimDispatchOnThisPass;
UINTN SaveCurrentPeimCount; UINTN SaveCurrentPeimCount;
UINTN SaveCurrentFvCount; UINTN SaveCurrentFvCount;
EFI_PEI_FILE_HANDLE SaveCurrentFileHandle; EFI_PEI_FILE_HANDLE SaveCurrentFileHandle;
@ -332,8 +330,6 @@ PeiDispatcher (
// satisfied, this dipatcher should run only once. // satisfied, this dipatcher should run only once.
// //
do { do {
PeimNeedingDispatch = FALSE;
PeimDispatchOnThisPass = FALSE;
for (FvCount = Private->CurrentPeimFvCount; FvCount < Private->FvCount; FvCount++) { for (FvCount = Private->CurrentPeimFvCount; FvCount < Private->FvCount; FvCount++) {
Private->CurrentPeimFvCount = FvCount; Private->CurrentPeimFvCount = FvCount;
@ -359,7 +355,7 @@ PeiDispatcher (
if (Private->Fv[FvCount].PeimState[PeimCount] == PEIM_STATE_NOT_DISPATCHED) { if (Private->Fv[FvCount].PeimState[PeimCount] == PEIM_STATE_NOT_DISPATCHED) {
if (!DepexSatisfied (Private, PeimFileHandle, PeimCount)) { if (!DepexSatisfied (Private, PeimFileHandle, PeimCount)) {
PeimNeedingDispatch = TRUE; Private->PeimNeedingDispatch = TRUE;
} else { } else {
Status = PeiFfsGetFileInfo (PeimFileHandle, &FvFileInfo); Status = PeiFfsGetFileInfo (PeimFileHandle, &FvFileInfo);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
@ -411,7 +407,7 @@ PeiDispatcher (
PeimEntryPoint (PeimFileHandle, (const EFI_PEI_SERVICES **) PeiServices); PeimEntryPoint (PeimFileHandle, (const EFI_PEI_SERVICES **) PeiServices);
} }
PeimDispatchOnThisPass = TRUE; Private->PeimDispatchOnThisPass = TRUE;
} }
REPORT_STATUS_CODE_WITH_EXTENDED_DATA ( REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
@ -580,11 +576,6 @@ PeiDispatcher (
// //
PrivateInMem->PeiMemoryInstalled = TRUE; PrivateInMem->PeiMemoryInstalled = TRUE;
//
// Restart scan of all PEIMs on next pass
//
PrivateInMem->CurrentPeimCount = 0;
// //
// Shadow PEI Core. When permanent memory is avaiable, shadow // Shadow PEI Core. When permanent memory is avaiable, shadow
// PEI Core and PEIMs to get high performance. // 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 // 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). // 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) { if (OldCoreData == NULL) {
PrivateData->PeimNeedingDispatch = FALSE;
PrivateData->PeimDispatchOnThisPass = FALSE;
PeiInitializeFv (PrivateData, SecCoreData); PeiInitializeFv (PrivateData, SecCoreData);
} }

View File

@ -137,6 +137,8 @@ typedef struct{
UINTN CurrentPeimFvCount; UINTN CurrentPeimFvCount;
UINTN CurrentPeimCount; UINTN CurrentPeimCount;
EFI_PEI_FILE_HANDLE CurrentFileHandle; EFI_PEI_FILE_HANDLE CurrentFileHandle;
BOOLEAN PeimNeedingDispatch;
BOOLEAN PeimDispatchOnThisPass;
UINTN AllFvCount; UINTN AllFvCount;
EFI_PEI_FV_HANDLE AllFv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)]; EFI_PEI_FV_HANDLE AllFv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];
EFI_PEI_HOB_POINTERS HobList; EFI_PEI_HOB_POINTERS HobList;