[SeaBIOS] [PATCH 1/6] vgabios: Compare PCI ids against pci rom struct instead of config settings.

Kevin O'Connor kevin at koconnor.net
Thu Feb 2 04:08:54 CET 2012


QEMU can update the pci rom struct - so use that as the location to
determine if the pci address passed into the option rom is accurate.

Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 vgasrc/vgabios.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/vgasrc/vgabios.c b/vgasrc/vgabios.c
index 2f24e78..e69c6c5 100644
--- a/vgasrc/vgabios.c
+++ b/vgasrc/vgabios.c
@@ -1279,8 +1279,10 @@ vga_post(struct bregs *regs)
 
     if (CONFIG_VGA_PCI) {
         u16 bdf = regs->ax;
-        if (pci_config_readw(bdf, PCI_VENDOR_ID) == CONFIG_VGA_VID
-            && pci_config_readw(bdf, PCI_DEVICE_ID) == CONFIG_VGA_DID)
+        if ((pci_config_readw(bdf, PCI_VENDOR_ID)
+             == GET_GLOBAL(rom_pci_data.vendor))
+            && (pci_config_readw(bdf, PCI_DEVICE_ID)
+                == GET_GLOBAL(rom_pci_data.device)))
             SET_VGA(VgaBDF, bdf);
     }
 
-- 
1.7.6.4




More information about the SeaBIOS mailing list