//\r
UINT32 Decodes;\r
\r
+ //\r
+ // TRUE if the ROM image is from the PCI Option ROM BAR\r
+ //\r
+ BOOLEAN EmbeddedRom;\r
+\r
//\r
// The OptionRom Size\r
//\r
&PlatformOpRomSize\r
);\r
if (!EFI_ERROR (Status)) {\r
+ PciIoDevice->EmbeddedRom = FALSE;\r
PciIoDevice->RomSize = PlatformOpRomSize;\r
PciIoDevice->PciIo.RomSize = PlatformOpRomSize;\r
PciIoDevice->PciIo.RomImage = PlatformOpRomBuffer;\r
&PlatformOpRomSize\r
);\r
if (!EFI_ERROR (Status)) {\r
+ PciIoDevice->EmbeddedRom = FALSE;\r
PciIoDevice->RomSize = PlatformOpRomSize;\r
PciIoDevice->PciIo.RomSize = PlatformOpRomSize;\r
PciIoDevice->PciIo.RomImage = PlatformOpRomBuffer;\r
EFI_PCI_IO_ATTRIBUTE_BUS_MASTER );\r
\r
} else {\r
+ //\r
+ // When this attribute is clear, the RomImage and RomSize fields in the PCI IO were\r
+ // initialized based on the PCI option ROM found through the ROM BAR of the PCI controller.\r
+ // When this attribute is set, the PCI option ROM described by the RomImage and RomSize\r
+ // fields is not from the the ROM BAR of the PCI controller.\r
+ //\r
+ if (!PciIoDevice->EmbeddedRom) {\r
+ Attributes |= EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM;\r
+ }\r
PciIoDevice->Attributes = Attributes;\r
}\r
}\r
\r
RomDecode (PciDevice, RomBarIndex, RomBar, FALSE);\r
\r
+ PciDevice->EmbeddedRom = TRUE;\r
PciDevice->PciIo.RomSize = RomImageSize;\r
PciDevice->PciIo.RomImage = RomInMemory;\r
\r