if ((Operation & GCD_MEMORY_SPACE_OPERATION) != 0) {\r
CoreAcquireGcdMemoryLock ();\r
Map = &mGcdMemorySpaceMap;\r
- }\r
- if ((Operation & GCD_IO_SPACE_OPERATION) != 0) {\r
+ } else if ((Operation & GCD_IO_SPACE_OPERATION) != 0) {\r
CoreAcquireGcdIoLock ();\r
Map = &mGcdIoSpaceMap;\r
+ } else {\r
+ ASSERT (FALSE);\r
}\r
\r
//\r
if ((Operation & GCD_MEMORY_SPACE_OPERATION) != 0) {\r
CoreAcquireGcdMemoryLock ();\r
Map = &mGcdMemorySpaceMap;\r
- }\r
- if ((Operation & GCD_IO_SPACE_OPERATION) != 0) {\r
+ } else if ((Operation & GCD_IO_SPACE_OPERATION) != 0) {\r
CoreAcquireGcdIoLock ();\r
Map = &mGcdIoSpaceMap;\r
+ } else {\r
+ ASSERT (FALSE);\r
}\r
\r
Found = FALSE;\r
EFI_PHYSICAL_ADDRESS HighAddress;\r
EFI_HOB_RESOURCE_DESCRIPTOR *MaxResourceHob;\r
EFI_HOB_GUID_TYPE *GuidHob;\r
+ UINT32 ReservedCodePageNumber;\r
\r
//\r
// Point at the first HOB. This must be the PHIT HOB.\r
// Cache the PHIT HOB for later use\r
//\r
PhitHob = Hob.HandoffInformationTable;\r
-\r
+ \r
+ if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {\r
+ ReservedCodePageNumber = PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber);\r
+ ReservedCodePageNumber += PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber);\r
+ \r
+ //\r
+ // cache the Top address for loading modules at Fixed Address \r
+ //\r
+ gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress = PhitHob->EfiMemoryTop \r
+ + EFI_PAGES_TO_SIZE(ReservedCodePageNumber);\r
+ }\r
//\r
// See if a Memory Type Information HOB is available\r
//\r
// The max address must be within the physically addressible range for the processor.\r
//\r
MaxMemoryLength = 0;\r
- MaxAddress = EFI_MAX_ADDRESS;\r
+ MaxAddress = MAX_ADDRESS;\r
do {\r
HighAddress = 0;\r
Found = FALSE;\r
// Add and allocate the remaining unallocated system memory to the memory services.\r
//\r
Status = CoreGetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap);\r
+ ASSERT (Status == EFI_SUCCESS);\r
+\r
for (Index = 0; Index < NumberOfDescriptors; Index++) {\r
if (MemorySpaceMap[Index].GcdMemoryType == EfiGcdMemoryTypeSystemMemory) {\r
if (MemorySpaceMap[Index].ImageHandle == NULL) {\r