#include "pci.h"
#include "console.h"
#include "net.h"
+#include "pass-through.h"
//#define DEBUG_PCI
target_phys_addr_t pci_mem_base;
static PCIBus *first_bus;
+extern int vga_passthrough;
+
static int pcibus_load(QEMUFile *f, void *opaque, int version_id)
{
int i, nirq;
PCIBus *s = opaque;
PCIDevice *pci_dev;
int config_addr, bus_num;
- uint32_t val;
+ uint32_t val = 0;
bus_num = (addr >> 16) & 0xff;
while (s && s->bus_num != bus_num)
goto the_end;
}
config_addr = addr & 0xff;
+
+
+ if (vga_passthrough && pci_dev->devfn == 0x00) //Host Bridge
+ {
+ if (config_addr == 0x52) // GMCH
+ val = pt_pci_host_read_word(0, 0, 0, 0x52);
+ if (config_addr == 0xa0) // Top of memory
+ val = pt_pci_host_read_byte(0, 0, 0, 0xa0);
+ if (config_addr == 0x02) // Device ID
+ val = pt_pci_host_read_byte(0, 0, 0, 0x02);
+ goto the_end;
+ }
+
val = pci_dev->config_read(pci_dev, config_addr, len);
#if defined(DEBUG_PCI)
printf("pci_config_read: %s: addr=%02x val=%08x len=%d\n",