From 4fb720763c32fa4a65c5ee78666553fe458ce212 Mon Sep 17 00:00:00 2001 From: jchen20 Date: Fri, 26 Feb 2010 07:43:00 +0000 Subject: [PATCH] Fix a bug in "Load module At fixed address" to enable it on IPF platform git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10106 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index 08c4500048..ddd149b23e 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -801,6 +801,12 @@ PeiDispatcher ( // Loading Module at Fixed Address is enabled // PeiLoadFixAddressHook(Private); + // + // if Loading Module at Fixed Address is enabled, This is the first invoke to page + // allocation for Pei Code range. This memory range should be reserved for loading PEIMs + // + LoadFixPeiCodeBegin = AllocatePages((UINTN)PcdGet32(PcdLoadFixAddressPeiCodePageNumber)); + DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PeiCodeBegin = 0x%lX, PeiCodeTop= 0x%lX\n", (UINT64)LoadFixPeiCodeBegin, (UINT64)((UINTN)LoadFixPeiCodeBegin + PcdGet32(PcdLoadFixAddressPeiCodePageNumber) * EFI_PAGE_SIZE))); } // @@ -941,15 +947,9 @@ PeiDispatcher ( PrivateInMem->PeimDispatcherReenter = TRUE; if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { - // - // if Loading Module at Fixed Address is enabled, This is the first invoke to page - // allocation for Pei Core segment. This memory segment should be reserved for loading PEIM - // - LoadFixPeiCodeBegin = AllocatePages((UINTN)PcdGet32(PcdLoadFixAddressPeiCodePageNumber)); - DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PeiCodeBegin = 0x%lx, PeiCodeTop= 0xl%x\n", (UINTN)LoadFixPeiCodeBegin, ((UINTN)LoadFixPeiCodeBegin) + PcdGet32(PcdLoadFixAddressPeiCodePageNumber) * EFI_PAGE_SIZE)); // // if Loading Module at Fixed Address is enabled, allocate the PEI code memory range usage bit map array. - // Every bit in the array indicate the status of the corresponding memory page, available or not + // Every bit in the array indicate the status of the corresponding memory page available or not // PrivateInMem->PeiCodeMemoryRangeUsageBitMap = AllocateZeroPool (((PcdGet32(PcdLoadFixAddressPeiCodePageNumber)>>6) + 1)*sizeof(UINT64)); } -- 2.39.2