/** @file\r
The file contains the GCD related services in the EFI Boot Services Table.\r
- The GCD services are used to manage the memory and I/O regions that \r
+ The GCD services are used to manage the memory and I/O regions that\r
are accessible to the CPU that is executing the DXE core.\r
\r
Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED | \\r
EFI_RESOURCE_ATTRIBUTE_16_BIT_IO | \\r
EFI_RESOURCE_ATTRIBUTE_32_BIT_IO | \\r
- EFI_RESOURCE_ATTRIBUTE_64_BIT_IO ) \r
+ EFI_RESOURCE_ATTRIBUTE_64_BIT_IO )\r
\r
#define TESTED_MEMORY_ATTRIBUTES (EFI_RESOURCE_ATTRIBUTE_PRESENT | \\r
EFI_RESOURCE_ATTRIBUTE_INITIALIZED | \\r
\r
EFI_GCD_MAP_ENTRY mGcdMemorySpaceMapEntryTemplate = {\r
EFI_GCD_MAP_SIGNATURE,\r
- { \r
+ {\r
NULL,\r
NULL\r
},\r
\r
GCD_ATTRIBUTE_CONVERSION_ENTRY mAttributeConversionTable[] = {\r
{ EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE, EFI_MEMORY_UC, TRUE },\r
- { EFI_RESOURCE_ATTRIBUTE_UNCACHED_EXPORTED, EFI_MEMORY_UCE, TRUE }, \r
+ { EFI_RESOURCE_ATTRIBUTE_UNCACHED_EXPORTED, EFI_MEMORY_UCE, TRUE },\r
{ EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE, EFI_MEMORY_WC, TRUE },\r
{ EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE, EFI_MEMORY_WT, TRUE },\r
{ EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE, EFI_MEMORY_WB, TRUE },\r
/**\r
Aligns a value to the specified boundary.\r
\r
- @param Value 64 bit value to align \r
- @param Alignment Log base 2 of the boundary to align Value to \r
- @param RoundUp TRUE if Value is to be rounded up to the nearest \r
- aligned boundary. FALSE is Value is to be \r
- rounded down to the nearest aligned boundary. \r
+ @param Value 64 bit value to align\r
+ @param Alignment Log base 2 of the boundary to align Value to\r
+ @param RoundUp TRUE if Value is to be rounded up to the nearest\r
+ aligned boundary. FALSE is Value is to be\r
+ rounded down to the nearest aligned boundary.\r
\r
@return A 64 bit value is the aligned to the value nearest Value with an alignment by Alignment.\r
\r
/**\r
Aligns address to the page boundary.\r
\r
- @param Value 64 bit address to align \r
+ @param Value 64 bit address to align\r
\r
@return A 64 bit value is the aligned to the value nearest Value with an alignment by Alignment.\r
\r
/**\r
Aligns length to the page boundary.\r
\r
- @param Value 64 bit length to align \r
+ @param Value 64 bit length to align\r
\r
@return A 64 bit value is the aligned to the value nearest Value with an alignment by Alignment.\r
\r
/**\r
Allocate pool for two entries.\r
\r
- @param TopEntry An entry of GCD map \r
- @param BottomEntry An entry of GCD map \r
+ @param TopEntry An entry of GCD map\r
+ @param BottomEntry An entry of GCD map\r
\r
- @retval EFI_OUT_OF_RESOURCES No enough buffer to be allocated. \r
+ @retval EFI_OUT_OF_RESOURCES No enough buffer to be allocated.\r
@retval EFI_SUCCESS Both entries successfully allocated.\r
\r
**/\r
/**\r
Internal function. Inserts a new descriptor into a sorted list\r
\r
- @param Link The linked list to insert the range BaseAddress \r
- and Length into \r
- @param Entry A pointer to the entry that is inserted \r
- @param BaseAddress The base address of the new range \r
- @param Length The length of the new range in bytes \r
- @param TopEntry Top pad entry to insert if needed. \r
- @param BottomEntry Bottom pad entry to insert if needed. \r
+ @param Link The linked list to insert the range BaseAddress\r
+ and Length into\r
+ @param Entry A pointer to the entry that is inserted\r
+ @param BaseAddress The base address of the new range\r
+ @param Length The length of the new range in bytes\r
+ @param TopEntry Top pad entry to insert if needed.\r
+ @param BottomEntry Bottom pad entry to insert if needed.\r
\r
@retval EFI_SUCCESS The new range was inserted into the linked list\r
\r
Entry->BaseAddress = BaseAddress;\r
BottomEntry->EndAddress = BaseAddress - 1;\r
InsertTailList (Link, &BottomEntry->Link);\r
- } \r
+ }\r
\r
if ((BaseAddress + Length - 1) < Entry->EndAddress) {\r
CopyMem (TopEntry, Entry, sizeof (EFI_GCD_MAP_ENTRY));\r
/**\r
Merge the Gcd region specified by Link and its adjacent entry.\r
\r
- @param Link Specify the entry to be merged (with its \r
- adjacent entry). \r
- @param Forward Direction (forward or backward). \r
- @param Map Boundary. \r
+ @param Link Specify the entry to be merged (with its\r
+ adjacent entry).\r
+ @param Forward Direction (forward or backward).\r
+ @param Map Boundary.\r
\r
- @retval EFI_SUCCESS Successfully returned. \r
+ @retval EFI_SUCCESS Successfully returned.\r
@retval EFI_UNSUPPORTED These adjacent regions could not merge.\r
\r
**/\r
/**\r
Merge adjacent entries on total chain.\r
\r
- @param TopEntry Top entry of GCD map. \r
- @param BottomEntry Bottom entry of GCD map. \r
- @param StartLink Start link of the list for this loop. \r
- @param EndLink End link of the list for this loop. \r
- @param Map Boundary. \r
+ @param TopEntry Top entry of GCD map.\r
+ @param BottomEntry Bottom entry of GCD map.\r
+ @param StartLink Start link of the list for this loop.\r
+ @param EndLink End link of the list for this loop.\r
+ @param Map Boundary.\r
\r
@retval EFI_SUCCESS GCD map successfully cleaned up.\r
\r
/**\r
Search a segment of memory space in GCD map. The result is a range of GCD entry list.\r
\r
- @param BaseAddress The start address of the segment. \r
- @param Length The length of the segment. \r
- @param StartLink The first GCD entry involves this segment of \r
- memory space. \r
- @param EndLink The first GCD entry involves this segment of \r
- memory space. \r
- @param Map Points to the start entry to search. \r
+ @param BaseAddress The start address of the segment.\r
+ @param Length The length of the segment.\r
+ @param StartLink The first GCD entry involves this segment of\r
+ memory space.\r
+ @param EndLink The first GCD entry involves this segment of\r
+ memory space.\r
+ @param Map Points to the start entry to search.\r
\r
- @retval EFI_SUCCESS Successfully found the entry. \r
+ @retval EFI_SUCCESS Successfully found the entry.\r
@retval EFI_NOT_FOUND Not found.\r
\r
**/\r
*StartLink = Link;\r
}\r
if (*StartLink != NULL) {\r
- if ((BaseAddress + Length - 1) >= Entry->BaseAddress && \r
+ if ((BaseAddress + Length - 1) >= Entry->BaseAddress &&\r
(BaseAddress + Length - 1) <= Entry->EndAddress ) {\r
*EndLink = Link;\r
return EFI_SUCCESS;\r
/**\r
Count the amount of GCD map entries.\r
\r
- @param Map Points to the start entry to do the count loop. \r
+ @param Map Points to the start entry to do the count loop.\r
\r
@return The count.\r
\r
Count++;\r
Link = Link->ForwardLink;\r
}\r
- \r
+\r
return Count;\r
}\r
\r
/**\r
Return the memory attribute specified by Attributes\r
\r
- @param Attributes A num with some attribute bits on. \r
+ @param Attributes A num with some attribute bits on.\r
\r
@return The enum value of memory attribute.\r
\r
/**\r
Do operation on a segment of memory space specified (add, free, remove, change attribute ...).\r
\r
- @param Operation The type of the operation \r
- @param GcdMemoryType Additional information for the operation \r
- @param GcdIoType Additional information for the operation \r
- @param BaseAddress Start address of the segment \r
- @param Length length of the segment \r
- @param Capabilities The alterable attributes of a newly added entry \r
- @param Attributes The attributes needs to be set \r
-\r
- @retval EFI_INVALID_PARAMETER Length is 0 or address (length) not aligned when \r
- setting attribute. \r
- @retval EFI_SUCCESS Action successfully done. \r
- @retval EFI_UNSUPPORTED Could not find the proper descriptor on this \r
- segment or set an upsupported attribute. \r
- @retval EFI_ACCESS_DENIED Operate on an space non-exist or is used for an \r
- image. \r
- @retval EFI_NOT_FOUND Free a non-using space or remove a non-exist \r
- space, and so on. \r
+ @param Operation The type of the operation\r
+ @param GcdMemoryType Additional information for the operation\r
+ @param GcdIoType Additional information for the operation\r
+ @param BaseAddress Start address of the segment\r
+ @param Length length of the segment\r
+ @param Capabilities The alterable attributes of a newly added entry\r
+ @param Attributes The attributes needs to be set\r
+\r
+ @retval EFI_INVALID_PARAMETER Length is 0 or address (length) not aligned when\r
+ setting attribute.\r
+ @retval EFI_SUCCESS Action successfully done.\r
+ @retval EFI_UNSUPPORTED Could not find the proper descriptor on this\r
+ segment or set an upsupported attribute.\r
+ @retval EFI_ACCESS_DENIED Operate on an space non-exist or is used for an\r
+ image.\r
+ @retval EFI_NOT_FOUND Free a non-using space or remove a non-exist\r
+ space, and so on.\r
@retval EFI_OUT_OF_RESOURCES No buffer could be allocated.\r
\r
**/\r
EFI_GCD_MAP_ENTRY *BottomEntry;\r
LIST_ENTRY *StartLink;\r
LIST_ENTRY *EndLink;\r
- \r
+\r
EFI_CPU_ARCH_PROTOCOL *CpuArch;\r
UINT64 CpuArchAttributes;\r
\r
/**\r
Check whether an entry could be used to allocate space.\r
\r
- @param Operation Allocate memory or IO \r
- @param Entry The entry to be tested \r
- @param GcdMemoryType The desired memory type \r
- @param GcdIoType The desired IO type \r
+ @param Operation Allocate memory or IO\r
+ @param Entry The entry to be tested\r
+ @param GcdMemoryType The desired memory type\r
+ @param GcdIoType The desired IO type\r
\r
- @retval EFI_NOT_FOUND The memory type does not match or there's an \r
- image handle on the entry. \r
- @retval EFI_UNSUPPORTED The operation unsupported. \r
- @retval EFI_SUCCESS It's ok for this entry to be used to allocate \r
+ @retval EFI_NOT_FOUND The memory type does not match or there's an\r
+ image handle on the entry.\r
+ @retval EFI_UNSUPPORTED The operation unsupported.\r
+ @retval EFI_SUCCESS It's ok for this entry to be used to allocate\r
space.\r
\r
**/\r
/**\r
Allocate space on specified address and length.\r
\r
- @param Operation The type of operation (memory or IO) \r
- @param GcdAllocateType The type of allocate operation \r
- @param GcdMemoryType The desired memory type \r
- @param GcdIoType The desired IO type \r
- @param Alignment Align with 2^Alignment \r
- @param Length Length to allocate \r
- @param BaseAddress Base address to allocate \r
- @param ImageHandle The image handle consume the allocated space. \r
- @param DeviceHandle The device handle consume the allocated space. \r
-\r
- @retval EFI_INVALID_PARAMETER Invalid parameter. \r
- @retval EFI_NOT_FOUND No descriptor for the desired space exists. \r
+ @param Operation The type of operation (memory or IO)\r
+ @param GcdAllocateType The type of allocate operation\r
+ @param GcdMemoryType The desired memory type\r
+ @param GcdIoType The desired IO type\r
+ @param Alignment Align with 2^Alignment\r
+ @param Length Length to allocate\r
+ @param BaseAddress Base address to allocate\r
+ @param ImageHandle The image handle consume the allocated space.\r
+ @param DeviceHandle The device handle consume the allocated space.\r
+\r
+ @retval EFI_INVALID_PARAMETER Invalid parameter.\r
+ @retval EFI_NOT_FOUND No descriptor for the desired space exists.\r
@retval EFI_SUCCESS Space successfully allocated.\r
\r
**/\r
/**\r
Add a segment of memory to GCD map.\r
\r
- @param GcdMemoryType Memory type of the segment. \r
- @param BaseAddress Base address of the segment. \r
- @param Length Length of the segment. \r
- @param Capabilities alterable attributes of the segment. \r
+ @param GcdMemoryType Memory type of the segment.\r
+ @param BaseAddress Base address of the segment.\r
+ @param Length Length of the segment.\r
+ @param Capabilities alterable attributes of the segment.\r
\r
- @retval EFI_INVALID_PARAMETER Invalid parameters. \r
+ @retval EFI_INVALID_PARAMETER Invalid parameters.\r
@retval EFI_SUCCESS Successfully add a segment of memory space.\r
\r
**/\r
Allocates nonexistent memory, reserved memory, system memory, or memorymapped\r
I/O resources from the global coherency domain of the processor.\r
\r
- @param GcdAllocateType The type of allocate operation \r
- @param GcdMemoryType The desired memory type \r
- @param Alignment Align with 2^Alignment \r
- @param Length Length to allocate \r
- @param BaseAddress Base address to allocate \r
- @param ImageHandle The image handle consume the allocated space. \r
- @param DeviceHandle The device handle consume the allocated space. \r
+ @param GcdAllocateType The type of allocate operation\r
+ @param GcdMemoryType The desired memory type\r
+ @param Alignment Align with 2^Alignment\r
+ @param Length Length to allocate\r
+ @param BaseAddress Base address to allocate\r
+ @param ImageHandle The image handle consume the allocated space.\r
+ @param DeviceHandle The device handle consume the allocated space.\r
\r
- @retval EFI_INVALID_PARAMETER Invalid parameter. \r
- @retval EFI_NOT_FOUND No descriptor contains the desired space. \r
+ @retval EFI_INVALID_PARAMETER Invalid parameter.\r
+ @retval EFI_NOT_FOUND No descriptor contains the desired space.\r
@retval EFI_SUCCESS Memory space successfully allocated.\r
\r
**/\r
)\r
{\r
return CoreAllocateSpace (\r
- GCD_ALLOCATE_MEMORY_OPERATION, \r
- GcdAllocateType, \r
- GcdMemoryType, \r
- (EFI_GCD_IO_TYPE) 0, \r
- Alignment, \r
- Length, \r
- BaseAddress, \r
- ImageHandle, \r
+ GCD_ALLOCATE_MEMORY_OPERATION,\r
+ GcdAllocateType,\r
+ GcdMemoryType,\r
+ (EFI_GCD_IO_TYPE) 0,\r
+ Alignment,\r
+ Length,\r
+ BaseAddress,\r
+ ImageHandle,\r
DeviceHandle\r
);\r
}\r
Adds reserved memory, system memory, or memory-mapped I/O resources to the\r
global coherency domain of the processor.\r
\r
- @param GcdMemoryType Memory type of the memory space. \r
- @param BaseAddress Base address of the memory space. \r
- @param Length Length of the memory space. \r
- @param Capabilities alterable attributes of the memory space. \r
+ @param GcdMemoryType Memory type of the memory space.\r
+ @param BaseAddress Base address of the memory space.\r
+ @param Length Length of the memory space.\r
+ @param Capabilities alterable attributes of the memory space.\r
\r
@retval EFI_SUCCESS Merged this memory space into GCD map.\r
\r
Status = CoreAllocateMemorySpace (\r
EfiGcdAllocateAddress,\r
GcdMemoryType,\r
- EFI_PAGE_SHIFT, \r
+ EFI_PAGE_SHIFT,\r
PageLength,\r
&PageBaseAddress,\r
gDxeCoreImageHandle,\r
Status = CoreAllocateMemorySpace (\r
EfiGcdAllocateAddress,\r
GcdMemoryType,\r
- EFI_PAGE_SHIFT, \r
+ EFI_PAGE_SHIFT,\r
EFI_PAGE_SIZE,\r
&PageBaseAddress,\r
gDxeCoreImageHandle,\r
Frees nonexistent memory, reserved memory, system memory, or memory-mapped\r
I/O resources from the global coherency domain of the processor.\r
\r
- @param BaseAddress Base address of the memory space. \r
- @param Length Length of the memory space. \r
+ @param BaseAddress Base address of the memory space.\r
+ @param Length Length of the memory space.\r
\r
@retval EFI_SUCCESS Space successfully freed.\r
\r
Removes reserved memory, system memory, or memory-mapped I/O resources from\r
the global coherency domain of the processor.\r
\r
- @param BaseAddress Base address of the memory space. \r
- @param Length Length of the memory space. \r
+ @param BaseAddress Base address of the memory space.\r
+ @param Length Length of the memory space.\r
\r
@retval EFI_SUCCESS Successfully remove a segment of memory space.\r
\r
/**\r
Build a memory descriptor according to an entry.\r
\r
- @param Descriptor The descriptor to be built \r
+ @param Descriptor The descriptor to be built\r
@param Entry According to this entry\r
\r
**/\r
/**\r
Retrieves the descriptor for a memory region containing a specified address.\r
\r
- @param BaseAddress Specified start address \r
- @param Descriptor Specified length \r
+ @param BaseAddress Specified start address\r
+ @param Descriptor Specified length\r
\r
- @retval EFI_INVALID_PARAMETER Invalid parameter \r
+ @retval EFI_INVALID_PARAMETER Invalid parameter\r
@retval EFI_SUCCESS Successfully get memory space descriptor.\r
\r
**/\r
CoreAcquireGcdMemoryLock ();\r
\r
//\r
- // Search for the list of descriptors that contain BaseAddress \r
+ // Search for the list of descriptors that contain BaseAddress\r
//\r
Status = CoreSearchGcdMapEntry (BaseAddress, 1, &StartLink, &EndLink, &mGcdMemorySpaceMap);\r
if (EFI_ERROR (Status)) {\r
Modifies the attributes for a memory region in the global coherency domain of the\r
processor.\r
\r
- @param BaseAddress Specified start address \r
- @param Length Specified length \r
- @param Attributes Specified attributes \r
+ @param BaseAddress Specified start address\r
+ @param Length Specified length\r
+ @param Attributes Specified attributes\r
\r
- @retval EFI_SUCCESS Successfully set attribute of a segment of \r
+ @retval EFI_SUCCESS Successfully set attribute of a segment of\r
memory space.\r
\r
**/\r
Returns a map of the memory resources in the global coherency domain of the\r
processor.\r
\r
- @param NumberOfDescriptors Number of descriptors. \r
- @param MemorySpaceMap Descriptor array \r
+ @param NumberOfDescriptors Number of descriptors.\r
+ @param MemorySpaceMap Descriptor array\r
\r
- @retval EFI_INVALID_PARAMETER Invalid parameter \r
- @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate \r
+ @retval EFI_INVALID_PARAMETER Invalid parameter\r
+ @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
@retval EFI_SUCCESS Successfully get memory space map.\r
\r
**/\r
/**\r
Adds reserved I/O or I/O resources to the global coherency domain of the processor.\r
\r
- @param GcdIoType IO type of the segment. \r
- @param BaseAddress Base address of the segment. \r
- @param Length Length of the segment. \r
+ @param GcdIoType IO type of the segment.\r
+ @param BaseAddress Base address of the segment.\r
+ @param Length Length of the segment.\r
\r
- @retval EFI_SUCCESS Merged this segment into GCD map. \r
+ @retval EFI_SUCCESS Merged this segment into GCD map.\r
@retval EFI_INVALID_PARAMETER Parameter not valid\r
\r
**/\r
Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
domain of the processor.\r
\r
- @param GcdAllocateType The type of allocate operation \r
- @param GcdIoType The desired IO type \r
- @param Alignment Align with 2^Alignment \r
- @param Length Length to allocate \r
- @param BaseAddress Base address to allocate \r
- @param ImageHandle The image handle consume the allocated space. \r
- @param DeviceHandle The device handle consume the allocated space. \r
+ @param GcdAllocateType The type of allocate operation\r
+ @param GcdIoType The desired IO type\r
+ @param Alignment Align with 2^Alignment\r
+ @param Length Length to allocate\r
+ @param BaseAddress Base address to allocate\r
+ @param ImageHandle The image handle consume the allocated space.\r
+ @param DeviceHandle The device handle consume the allocated space.\r
\r
- @retval EFI_INVALID_PARAMETER Invalid parameter. \r
- @retval EFI_NOT_FOUND No descriptor contains the desired space. \r
+ @retval EFI_INVALID_PARAMETER Invalid parameter.\r
+ @retval EFI_NOT_FOUND No descriptor contains the desired space.\r
@retval EFI_SUCCESS IO space successfully allocated.\r
\r
**/\r
)\r
{\r
return CoreAllocateSpace (\r
- GCD_ALLOCATE_IO_OPERATION, \r
- GcdAllocateType, \r
- (EFI_GCD_MEMORY_TYPE) 0, \r
- GcdIoType, \r
- Alignment, \r
- Length, \r
- BaseAddress, \r
- ImageHandle, \r
+ GCD_ALLOCATE_IO_OPERATION,\r
+ GcdAllocateType,\r
+ (EFI_GCD_MEMORY_TYPE) 0,\r
+ GcdIoType,\r
+ Alignment,\r
+ Length,\r
+ BaseAddress,\r
+ ImageHandle,\r
DeviceHandle\r
);\r
}\r
Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
domain of the processor.\r
\r
- @param BaseAddress Base address of the segment. \r
- @param Length Length of the segment. \r
+ @param BaseAddress Base address of the segment.\r
+ @param Length Length of the segment.\r
\r
@retval EFI_SUCCESS Space successfully freed.\r
\r
Removes reserved I/O or I/O resources from the global coherency domain of the\r
processor.\r
\r
- @param BaseAddress Base address of the segment. \r
- @param Length Length of the segment. \r
+ @param BaseAddress Base address of the segment.\r
+ @param Length Length of the segment.\r
\r
@retval EFI_SUCCESS Successfully removed a segment of IO space.\r
\r
/**\r
Build a IO descriptor according to an entry.\r
\r
- @param Descriptor The descriptor to be built \r
+ @param Descriptor The descriptor to be built\r
@param Entry According to this entry\r
\r
**/\r
/**\r
Retrieves the descriptor for an I/O region containing a specified address.\r
\r
- @param BaseAddress Specified start address \r
- @param Descriptor Specified length \r
+ @param BaseAddress Specified start address\r
+ @param Descriptor Specified length\r
\r
- @retval EFI_INVALID_PARAMETER Descriptor is NULL. \r
+ @retval EFI_INVALID_PARAMETER Descriptor is NULL.\r
@retval EFI_SUCCESS Successfully get the IO space descriptor.\r
\r
**/\r
CoreAcquireGcdIoLock ();\r
\r
//\r
- // Search for the list of descriptors that contain BaseAddress \r
+ // Search for the list of descriptors that contain BaseAddress\r
//\r
Status = CoreSearchGcdMapEntry (BaseAddress, 1, &StartLink, &EndLink, &mGcdIoSpaceMap);\r
if (EFI_ERROR (Status)) {\r
/**\r
Returns a map of the I/O resources in the global coherency domain of the processor.\r
\r
- @param NumberOfDescriptors Number of descriptors. \r
- @param IoSpaceMap Descriptor array \r
+ @param NumberOfDescriptors Number of descriptors.\r
+ @param IoSpaceMap Descriptor array\r
\r
- @retval EFI_INVALID_PARAMETER Invalid parameter \r
- @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate \r
+ @retval EFI_INVALID_PARAMETER Invalid parameter\r
+ @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
@retval EFI_SUCCESS Successfully get IO space map.\r
\r
**/\r
Done:\r
CoreReleaseGcdIoLock ();\r
return Status;\r
-} \r
+}\r
\r
\r
/**\r
Converts a Resource Descriptor HOB attributes mask to an EFI Memory Descriptor\r
capabilities mask\r
\r
- @param GcdMemoryType Type of resource in the GCD memory map. \r
- @param Attributes The attribute mask in the Resource Descriptor \r
- HOB. \r
+ @param GcdMemoryType Type of resource in the GCD memory map.\r
+ @param Attributes The attribute mask in the Resource Descriptor\r
+ HOB.\r
\r
@return The capabilities mask for an EFI Memory Descriptor.\r
\r
{\r
UINT64 Capabilities;\r
GCD_ATTRIBUTE_CONVERSION_ENTRY *Conversion;\r
- \r
+\r
//\r
// Convert the Resource HOB Attributes to an EFI Memory Capabilities mask\r
//\r
}\r
}\r
}\r
- \r
+\r
return Capabilities;\r
}\r
\r
memory descriptor is provided to the memory services. Then the memory services\r
can be used to intialize the GCD map.\r
\r
- @param HobStart The start address of the HOB. \r
- @param MemoryBaseAddress Start address of memory region found to init DXE \r
- core. \r
- @param MemoryLength Length of memory region found to init DXE core. \r
+ @param HobStart The start address of the HOB.\r
+ @param MemoryBaseAddress Start address of memory region found to init DXE\r
+ core.\r
+ @param MemoryLength Length of memory region found to init DXE core.\r
\r
@retval EFI_SUCCESS Memory services successfully initialized.\r
\r
if (ResourceHob->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY &&\r
(ResourceHob->ResourceAttribute & MEMORY_ATTRIBUTE_MASK) == TESTED_MEMORY_ATTRIBUTES ) {\r
\r
- if (PhitHob->EfiFreeMemoryBottom >= ResourceHob->PhysicalStart && \r
+ if (PhitHob->EfiFreeMemoryBottom >= ResourceHob->PhysicalStart &&\r
PhitHob->EfiFreeMemoryTop <= (ResourceHob->PhysicalStart + ResourceHob->ResourceLength) ) {\r
\r
//\r
can be used to intialize the GCD map. The HobStart will be relocated to a pool\r
buffer.\r
\r
- @param HobStart The start address of the HOB \r
- @param MemoryBaseAddress Start address of memory region found to init DXE \r
- core. \r
- @param MemoryLength Length of memory region found to init DXE core. \r
+ @param HobStart The start address of the HOB\r
+ @param MemoryBaseAddress Start address of memory region found to init DXE\r
+ core.\r
+ @param MemoryLength Length of memory region found to init DXE core.\r
\r
@retval EFI_SUCCESS GCD services successfully initialized.\r
\r
ASSERT (CpuHob != NULL);\r
SizeOfMemorySpace = CpuHob->SizeOfMemorySpace;\r
SizeOfIoSpace = CpuHob->SizeOfIoSpace;\r
- \r
+\r
//\r
// Initialize the GCD Memory Space Map\r
//\r
InsertHeadList (&mGcdIoSpaceMap, &Entry->Link);\r
\r
//\r
- // Walk the HOB list and add all resource descriptors to the GCD \r
+ // Walk the HOB list and add all resource descriptors to the GCD\r
//\r
for (Hob.Raw = *HobStart; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {\r
\r
if (!EFI_ERROR (Status)) {\r
Status = CoreAllocateMemorySpace (\r
EfiGcdAllocateAddress,\r
- Descriptor.GcdMemoryType, \r
+ Descriptor.GcdMemoryType,\r
0,\r
MemoryHob->AllocDescriptor.MemoryLength,\r
&BaseAddress,\r
BaseAddress = FirmwareVolumeHob->BaseAddress;\r
Status = CoreAllocateMemorySpace (\r
EfiGcdAllocateAddress,\r
- EfiGcdMemoryTypeMemoryMappedIo, \r
+ EfiGcdMemoryTypeMemoryMappedIo,\r
0,\r
FirmwareVolumeHob->Length,\r
&BaseAddress,\r
// Relocate HOB List to an allocated pool buffer.\r
//\r
NewHobList = CoreAllocateCopyPool (\r
- (UINTN)PhitHob->EfiFreeMemoryBottom - (UINTN)(*HobStart), \r
+ (UINTN)PhitHob->EfiFreeMemoryBottom - (UINTN)(*HobStart),\r
*HobStart\r
);\r
ASSERT (NewHobList != NULL);\r