"NonExist", // EfiGcdIoTypeNonExistent\r
"Reserved", // EfiGcdIoTypeReserved\r
"I/O ", // EfiGcdIoTypeIo\r
- "Unknown " // EfiGcdIoTypeMaximum \r
+ "Unknown " // EfiGcdIoTypeMaximum\r
};\r
\r
///\r
PcdDebugPrintErrorLevel has the DEBUG_GCD bit set.\r
\r
@param InitialMap TRUE if the initial GCD Memory Map is being dumped. Otherwise, FALSE.\r
- \r
+\r
**/\r
VOID\r
EFIAPI\r
UINTN NumberOfDescriptors;\r
EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap;\r
UINTN Index;\r
- \r
+\r
Status = CoreGetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap);\r
ASSERT (Status == EFI_SUCCESS && MemorySpaceMap != NULL);\r
\r
DEBUG ((DEBUG_GCD, "GCDMemType Range Capabilities Attributes \n"));\r
DEBUG ((DEBUG_GCD, "========== ================================= ================ ================\n"));\r
for (Index = 0; Index < NumberOfDescriptors; Index++) {\r
- DEBUG ((DEBUG_GCD, "%a %016lx-%016lx %016lx %016lx%c\n", \r
+ DEBUG ((DEBUG_GCD, "%a %016lx-%016lx %016lx %016lx%c\n",\r
mGcdMemoryTypeNames[MIN (MemorySpaceMap[Index].GcdMemoryType, EfiGcdMemoryTypeMaximum)],\r
- MemorySpaceMap[Index].BaseAddress, \r
+ MemorySpaceMap[Index].BaseAddress,\r
MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length - 1,\r
- MemorySpaceMap[Index].Capabilities, \r
+ MemorySpaceMap[Index].Capabilities,\r
MemorySpaceMap[Index].Attributes,\r
MemorySpaceMap[Index].ImageHandle == NULL ? ' ' : '*'\r
));\r
}\r
\r
/**\r
- Dump the entire contents if the GCD I/O Space Map using DEBUG() macros when \r
+ Dump the entire contents if the GCD I/O Space Map using DEBUG() macros when\r
PcdDebugPrintErrorLevel has the DEBUG_GCD bit set.\r
\r
@param InitialMap TRUE if the initial GCD I/O Map is being dumped. Otherwise, FALSE.\r
- \r
+\r
**/\r
VOID\r
EFIAPI\r
UINTN NumberOfDescriptors;\r
EFI_GCD_IO_SPACE_DESCRIPTOR *IoSpaceMap;\r
UINTN Index;\r
- \r
+\r
Status = CoreGetIoSpaceMap (&NumberOfDescriptors, &IoSpaceMap);\r
ASSERT (Status == EFI_SUCCESS && IoSpaceMap != NULL);\r
- \r
+\r
if (InitialMap) {\r
DEBUG ((DEBUG_GCD, "GCD:Initial GCD I/O Space Map\n"));\r
- } \r
- \r
+ }\r
+\r
DEBUG ((DEBUG_GCD, "GCDIoType Range \n"));\r
DEBUG ((DEBUG_GCD, "========== =================================\n"));\r
for (Index = 0; Index < NumberOfDescriptors; Index++) {\r
- DEBUG ((DEBUG_GCD, "%a %016lx-%016lx%c\n", \r
+ DEBUG ((DEBUG_GCD, "%a %016lx-%016lx%c\n",\r
mGcdIoTypeNames[MIN (IoSpaceMap[Index].GcdIoType, EfiGcdIoTypeMaximum)],\r
- IoSpaceMap[Index].BaseAddress, \r
+ IoSpaceMap[Index].BaseAddress,\r
IoSpaceMap[Index].BaseAddress + IoSpaceMap[Index].Length - 1,\r
IoSpaceMap[Index].ImageHandle == NULL ? ' ' : '*'\r
));\r
FreePool (IoSpaceMap);\r
);\r
}\r
- \r
+\r
/**\r
Validate resource descriptor HOB's attributes.\r
\r
- If Attributes includes some memory resource's settings, it should include \r
+ If Attributes includes some memory resource's settings, it should include\r
the corresponding capabilites also.\r
\r
@param Attributes Resource descriptor HOB attributes.\r
//\r
CpuArchAttributes = ConverToCpuArchAttributes (Attributes);\r
//\r
- // CPU arch attributes include page attributes and cache attributes. \r
+ // CPU arch attributes include page attributes and cache attributes.\r
// Only page attributes supports to be cleared, but not cache attributes.\r
// Caller is expected to use GetMemorySpaceDescriptor() to get the current\r
// attributes, AND/OR attributes, and then calls SetMemorySpaceAttributes()\r
// to set the new attributes.\r
// So 0 CPU arch attributes should not happen as memory should always have\r
- // a cache attribute (no matter UC or WB, etc). \r
+ // a cache attribute (no matter UC or WB, etc).\r
//\r
// Here, 0 CPU arch attributes will be filtered to be compatible with the\r
// case that caller just calls SetMemorySpaceAttributes() with none CPU\r
DEBUG ((DEBUG_GCD, " (BaseAddress = %016lx)", *BaseAddress));\r
}\r
DEBUG ((DEBUG_GCD, "\n"));\r
- \r
+\r
if ((Operation & GCD_MEMORY_SPACE_OPERATION) != 0) {\r
CoreReleaseGcdMemoryLock ();\r
CoreDumpGcdMemorySpaceMap (FALSE);\r
DEBUG ((DEBUG_GCD, " Alignment = %016lx\n", LShiftU64 (1, Alignment)));\r
DEBUG ((DEBUG_GCD, " ImageHandle = %p\n", ImageHandle));\r
DEBUG ((DEBUG_GCD, " DeviceHandle = %p\n", DeviceHandle));\r
- \r
+\r
return CoreAllocateSpace (\r
GCD_ALLOCATE_MEMORY_OPERATION,\r
GcdAllocateType,\r
)\r
{\r
DEBUG ((DEBUG_GCD, "GCD:RemoveMemorySpace(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));\r
- \r
+\r
return CoreConvertSpace (GCD_REMOVE_MEMORY_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, 0);\r
}\r
\r
@param Attributes Specified attributes\r
\r
@retval EFI_SUCCESS The attributes were set for the memory region.\r
- @retval EFI_INVALID_PARAMETER Length is zero. \r
+ @retval EFI_INVALID_PARAMETER Length is zero.\r
@retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory\r
resource range specified by BaseAddress and Length.\r
@retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource\r
{\r
DEBUG ((DEBUG_GCD, "GCD:AddIoSpace(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));\r
DEBUG ((DEBUG_GCD, " GcdIoType = %a\n", mGcdIoTypeNames[MIN (GcdIoType, EfiGcdIoTypeMaximum)]));\r
- \r
+\r
//\r
// Make sure parameters are valid\r
//\r
DEBUG ((DEBUG_GCD, " Alignment = %016lx\n", LShiftU64 (1, Alignment)));\r
DEBUG ((DEBUG_GCD, " ImageHandle = %p\n", ImageHandle));\r
DEBUG ((DEBUG_GCD, " DeviceHandle = %p\n", DeviceHandle));\r
- \r
+\r
return CoreAllocateSpace (\r
GCD_ALLOCATE_IO_OPERATION,\r
GcdAllocateType,\r
)\r
{\r
DEBUG ((DEBUG_GCD, "GCD:RemoveIoSpace(Base=%016lx,Length=%016lx)\n", BaseAddress, Length));\r
- \r
+\r
return CoreConvertSpace (GCD_REMOVE_IO_OPERATION, (EFI_GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, 0, 0);\r
}\r
\r
// Cache the PHIT HOB for later use\r
//\r
PhitHob = Hob.HandoffInformationTable;\r
- \r
+\r
if (PcdGet64(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
+ 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
Length = PageAlignLength (ResourceHob->PhysicalStart + ResourceHob->ResourceLength - BaseAddress);\r
if (Length < MinimalMemorySizeNeeded) {\r
//\r
- // If that range is not large enough to intialize the DXE Core, then \r
+ // If that range is not large enough to intialize the DXE Core, then\r
// Compute range between PHIT EfiFreeMemoryBottom and PHIT EfiFreeMemoryTop\r
//\r
BaseAddress = PageAlignAddress (PhitHob->EfiFreeMemoryBottom);\r
Length = PageAlignLength (PhitHob->EfiFreeMemoryTop - BaseAddress);\r
if (Length < MinimalMemorySizeNeeded) {\r
//\r
- // If that range is not large enough to intialize the DXE Core, then \r
+ // If that range is not large enough to intialize the DXE Core, then\r
// Compute range between the start of the Resource Descriptor HOB and the start of the HOB List\r
//\r
BaseAddress = PageAlignAddress (ResourceHob->PhysicalStart);\r
//\r
BaseAddress = TestedMemoryBaseAddress;\r
Length = TestedMemoryLength;\r
- Attributes = ResourceHob->ResourceAttribute; \r
+ Attributes = ResourceHob->ResourceAttribute;\r
HighAddress = ResourceHob->PhysicalStart;\r
}\r
}\r
InsertHeadList (&mGcdMemorySpaceMap, &Entry->Link);\r
\r
CoreDumpGcdMemorySpaceMap (TRUE);\r
- \r
+\r
//\r
// Initialize the GCD I/O Space Map\r
//\r
InsertHeadList (&mGcdIoSpaceMap, &Entry->Link);\r
\r
CoreDumpGcdIoSpaceMap (TRUE);\r
- \r
+\r
//\r
// Walk the HOB list and add all resource descriptors to the GCD\r
//\r