From 1053e0c513f4f72cb6fb9f4efe6aa2933695dbd6 Mon Sep 17 00:00:00 2001 From: qwang12 Date: Fri, 28 Sep 2007 14:27:53 +0000 Subject: [PATCH] Merge in bug fix from EDK1's PiPei Dispatcher.c git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3973 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index b9780a2c7b..9d73c53bb1 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -228,6 +228,7 @@ Returns: BOOLEAN PeimNeedingDispatch; BOOLEAN PeimDispatchOnThisPass; UINTN SaveCurrentPeimCount; + UINTN SaveCurrentFvCount; EFI_PEI_FILE_HANDLE SaveCurrentFileHandle; VOID *TopOfStack; PEI_CORE_PARAMETERS PeiCoreParameters; @@ -244,9 +245,10 @@ Returns: // update the modules' status from PEIM_STATE_REGISITER_FOR_SHADOW to PEIM_STATE_DONE. // SaveCurrentPeimCount = Private->CurrentPeimCount; + SaveCurrentFvCount = Private->CurrentPeimFvCount; SaveCurrentFileHandle = Private->CurrentFileHandle; - for (Index1 = 0;Index1 <= Private->CurrentPeimFvCount; Index1++) { + for (Index1 = 0; Index1 <= SaveCurrentFvCount; Index1++) { for (Index2 = 0; (Index2 < PEI_CORE_MAX_PEIM_PER_FV) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) { if (Private->Fv[Index1].PeimState[Index2] == PEIM_STATE_REGISITER_FOR_SHADOW) { PeimFileHandle = Private->Fv[Index1].FvFileHandles[Index2]; @@ -261,8 +263,9 @@ Returns: // PEIM_STATE_REGISITER_FOR_SHADOW move to PEIM_STATE_DONE // Private->Fv[Index1].PeimState[Index2]++; - Private->CurrentFileHandle = PeimFileHandle; - Private->CurrentPeimCount = Index2; + Private->CurrentFileHandle = PeimFileHandle; + Private->CurrentPeimFvCount = Index1; + Private->CurrentPeimCount = Index2; // // Call the PEIM entry point // @@ -281,8 +284,9 @@ Returns: } } } - Private->CurrentFileHandle = SaveCurrentFileHandle; - Private->CurrentPeimCount = SaveCurrentPeimCount; + Private->CurrentFileHandle = SaveCurrentFileHandle; + Private->CurrentPeimFvCount = SaveCurrentFvCount; + Private->CurrentPeimCount = SaveCurrentPeimCount; } // -- 2.39.2