+STATIC\r
+EFI_STATUS\r
+MapGcdMmioSpace (\r
+ IN UINT64 Base,\r
+ IN UINT64 Size\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+\r
+ Status = gDS->AddMemorySpace (EfiGcdMemoryTypeMemoryMappedIo, Base, Size,\r
+ EFI_MEMORY_UC);\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_ERROR,\r
+ "%a: failed to add GCD memory space for region [0x%Lx+0x%Lx)\n",\r
+ __FUNCTION__, Base, Size));\r
+ return Status;\r
+ }\r
+\r
+ Status = gDS->SetMemorySpaceAttributes (Base, Size, EFI_MEMORY_UC);\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_ERROR,\r
+ "%a: failed to set memory space attributes for region [0x%Lx+0x%Lx)\n",\r
+ __FUNCTION__, Base, Size));\r
+ }\r
+ return Status;\r
+}\r
+\r