\r
for (Idx = 0; Idx < NoHandles; ++Idx) {\r
EFI_PCI_IO_PROTOCOL *PciIo;\r
+ UINT64 Attributes;\r
\r
//\r
// Look up PciIo on the handle and stash it\r
goto RestoreAttributes;\r
}\r
\r
+ //\r
+ // Retrieve supported attributes\r
+ //\r
+ Status = PciIo->Attributes (PciIo, EfiPciIoAttributeOperationSupported, 0,\r
+ &Attributes);\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_WARN, "%a: EfiPciIoAttributeOperationSupported: %r\n",\r
+ __FUNCTION__, Status));\r
+ goto RestoreAttributes;\r
+ }\r
+\r
//\r
// Enable IO and MMIO decoding\r
//\r
+ Attributes &= EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY;\r
Status = PciIo->Attributes (PciIo, EfiPciIoAttributeOperationEnable,\r
- EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY,\r
- NULL);\r
+ Attributes, NULL);\r
if (EFI_ERROR (Status)) {\r
DEBUG ((EFI_D_WARN, "%a: EfiPciIoAttributeOperationEnable: %r\n",\r
__FUNCTION__, Status));\r