PcdGet64 (PcdPciIoSize) - 1;\r
mResAperture[0][0].IoTranslation = PcdGet64 (PcdPciIoTranslation);\r
\r
+ //\r
+ // Add IO and MMIO memory space, so that resources can be allocated in the\r
+ // EfiPciHostBridgeAllocateResources phase.\r
+ //\r
+ Status = gDS->AddIoSpace (\r
+ EfiGcdIoTypeIo,\r
+ PcdGet64 (PcdPciIoBase),\r
+ PcdGet64 (PcdPciIoSize)\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ Status = gDS->AddMemorySpace (\r
+ EfiGcdMemoryTypeMemoryMappedIo,\r
+ PcdGet32 (PcdPciMmio32Base),\r
+ PcdGet32 (PcdPciMmio32Size),\r
+ EFI_MEMORY_UC\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "%a: AddMemorySpace: %r\n", __FUNCTION__, Status));\r
+ return Status;\r
+ }\r
+\r
//\r
// Create Host Bridge Device Handle\r
//\r