]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix a bug in "Load module At fixed address" to enable it on IPF platform
authorjchen20 <jchen20@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 26 Feb 2010 07:43:00 +0000 (07:43 +0000)
committerjchen20 <jchen20@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 26 Feb 2010 07:43:00 +0000 (07:43 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10106 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c

index 08c450004896d66d78c7b5e816fb5c11e3eeddc7..ddd149b23e364f4c01270d2ca577e79d39fd7916 100644 (file)
@@ -801,6 +801,12 @@ PeiDispatcher (
                 // Loading Module at Fixed Address is enabled\r
                 //\r
                 PeiLoadFixAddressHook(Private);\r
+                //\r
+                // if Loading Module at Fixed Address is enabled, This is the first invoke to page\r
+                // allocation for Pei Code range. This memory range should be reserved for loading PEIMs\r
+                //\r
+                LoadFixPeiCodeBegin = AllocatePages((UINTN)PcdGet32(PcdLoadFixAddressPeiCodePageNumber));\r
+                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)));\r
               }\r
               \r
               //\r
@@ -941,15 +947,9 @@ PeiDispatcher (
               PrivateInMem->PeimDispatcherReenter  = TRUE;\r
               \r
               if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {\r
-                //\r
-                // if Loading Module at Fixed Address is enabled, This is the first invoke to page \r
-                // allocation for Pei Core segment. This memory segment should be reserved for loading PEIM\r
-                //\r
-                LoadFixPeiCodeBegin = AllocatePages((UINTN)PcdGet32(PcdLoadFixAddressPeiCodePageNumber));\r
-                DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PeiCodeBegin = 0x%lx, PeiCodeTop= 0xl%x\n", (UINTN)LoadFixPeiCodeBegin, ((UINTN)LoadFixPeiCodeBegin) + PcdGet32(PcdLoadFixAddressPeiCodePageNumber) * EFI_PAGE_SIZE));                 \r
                 //\r
                 // if Loading Module at Fixed Address is enabled, allocate the PEI code memory range usage bit map array.\r
-                // Every bit in the array indicate the status of the corresponding memory page, available or not\r
+                // Every bit in the array indicate the status of the corresponding memory page available or not\r
                 //\r
                 PrivateInMem->PeiCodeMemoryRangeUsageBitMap = AllocateZeroPool (((PcdGet32(PcdLoadFixAddressPeiCodePageNumber)>>6) + 1)*sizeof(UINT64));\r
               }\r