Enable the Load Module At fixed Address feature

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9937 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jchen20
2010-02-05 07:54:16 +00:00
parent f3198cba84
commit 54ea99a798
12 changed files with 972 additions and 61 deletions

View File

@@ -1765,6 +1765,7 @@ CoreInitializeMemoryServices (
EFI_PHYSICAL_ADDRESS HighAddress;
EFI_HOB_RESOURCE_DESCRIPTOR *MaxResourceHob;
EFI_HOB_GUID_TYPE *GuidHob;
UINT32 ReservedCodePageNumber;
//
// Point at the first HOB. This must be the PHIT HOB.
@@ -1795,7 +1796,17 @@ CoreInitializeMemoryServices (
// Cache the PHIT HOB for later use
//
PhitHob = Hob.HandoffInformationTable;
if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
ReservedCodePageNumber = PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber);
ReservedCodePageNumber += PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber);
//
// cache the Top address for loading modules at Fixed Address
//
gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress = PhitHob->EfiMemoryTop
+ EFI_PAGES_TO_SIZE(ReservedCodePageNumber);
}
//
// See if a Memory Type Information HOB is available
//