X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FCore%2FDxe%2FGcd%2FGcd.c;h=2a026c0724402fb87e62a527246984b970050b23;hp=8081fef1b083cddc827ff4cc18fdb97bb0a6072a;hb=54ea99a798f7d714b59503fcc21ee97878bc6492;hpb=f3198cba84f56f85281b87c4e9bf96e77a934f16 diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c index 8081fef1b0..2a026c0724 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -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 //