From 5c5a0601e8a9e382e5091442882d2db93dfc44ed Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Sat, 19 Jul 2008 15:56:49 +0000 Subject: [PATCH] Fix a bug that PeiCore might fail to fix up Ppi pointer in CAR. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5527 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 5 +++-- MdeModulePkg/Core/Pei/PeiMain.h | 7 ++++--- MdeModulePkg/Core/Pei/Ppi/Ppi.c | 10 ++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index 481cf5d02e..f18e954f2a 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -473,7 +473,7 @@ PeiDispatcher ( // Update HandOffHob for new installed permenent memory // OldHandOffTable = Private->HobList.HandoffInformationTable; - OldCheckingBottom = (UINTN)OldHandOffTable; + OldCheckingBottom = (UINTN)(SecCoreData->TemporaryRamBase); OldCheckingTop = (UINTN)(OldCheckingBottom + SecCoreData->TemporaryRamSize); // @@ -552,7 +552,8 @@ PeiDispatcher ( ConvertPpiPointers ((CONST EFI_PEI_SERVICES **)PeiServices, OldCheckingBottom, OldCheckingTop, - NewHandOffTable); + HeapOffset + ); DEBUG ((EFI_D_INFO, "Stack Hob: BaseAddress=0x%X Length=0x%X\n", (UINTN)PrivateInMem->StackBase, diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h index 8e87aaae05..7f7ac196d6 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.h +++ b/MdeModulePkg/Core/Pei/PeiMain.h @@ -325,15 +325,16 @@ InitializePpiServices ( @param PeiServices The PEI core services table. @param OldCheckingBottom The old checking bottom. @param OldCheckingTop The old checking top. - @param NewHandOffHob The new handoff HOB list. + @param Fixup The address difference between + the new Hob list and old Hob list. **/ VOID ConvertPpiPointers ( - IN CONST EFI_PEI_SERVICES **PeiServices, + IN CONST EFI_PEI_SERVICES **PeiServices, IN UINTN OldCheckingBottom, IN UINTN OldCheckingTop, - IN EFI_HOB_HANDOFF_INFO_TABLE *NewHandOffHob + IN UINTN Fixup ) ; diff --git a/MdeModulePkg/Core/Pei/Ppi/Ppi.c b/MdeModulePkg/Core/Pei/Ppi/Ppi.c index fa60d82a5b..b7a9b12321 100644 --- a/MdeModulePkg/Core/Pei/Ppi/Ppi.c +++ b/MdeModulePkg/Core/Pei/Ppi/Ppi.c @@ -44,26 +44,24 @@ InitializePpiServices ( @param PeiServices The PEI core services table. @param OldCheckingBottom The old checking bottom. @param OldCheckingTop The old checking top. - @param NewHandOffHob The new handoff HOB list. + @param Fixup The address difference between + the new Hob list and old Hob list. **/ VOID ConvertPpiPointers ( - IN CONST EFI_PEI_SERVICES **PeiServices, + IN CONST EFI_PEI_SERVICES **PeiServices, IN UINTN OldCheckingBottom, IN UINTN OldCheckingTop, - IN EFI_HOB_HANDOFF_INFO_TABLE *NewHandOffHob + IN UINTN Fixup ) { PEI_CORE_INSTANCE *PrivateData; UINT8 Index; PEI_PPI_LIST_POINTERS *PpiPointer; - UINTN Fixup; PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices); - Fixup = (UINTN)NewHandOffHob - OldCheckingBottom; - for (Index = 0; Index < FixedPcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) { if (Index < PrivateData->PpiData.PpiListEnd || Index > PrivateData->PpiData.NotifyListEnd) { -- 2.39.2