target_phys_addr_t pci_mem_base;
static uint16_t pci_default_sub_vendor_id = PCI_SUBVENDOR_ID_REDHAT_QUMRANET;
static uint16_t pci_default_sub_device_id = PCI_SUBDEVICE_ID_QEMU;
-static int pci_irq_index;
static PCIBus *first_bus;
static void pcibus_save(QEMUFile *f, void *opaque)
PCIConfigReadFunc *config_read,
PCIConfigWriteFunc *config_write)
{
- if (pci_irq_index >= PCI_DEVICES_MAX)
- return NULL;
-
if (devfn < 0) {
for(devfn = bus->devfn_min ; devfn < 256; devfn += 8) {
if (!bus->devices[devfn])
config_write = pci_default_write_config;
pci_dev->config_read = config_read;
pci_dev->config_write = config_write;
- pci_dev->irq_index = pci_irq_index++;
bus->devices[devfn] = pci_dev;
pci_dev->irq = qemu_allocate_irqs(pci_set_irq, pci_dev, 4);
return pci_dev;
pci_unregister_io_regions(pci_dev);
qemu_free_irqs(pci_dev->irq);
- pci_irq_index--;
pci_dev->bus->devices[pci_dev->devfn] = NULL;
qdev_free(&pci_dev->qdev);
return 0;
#define PCI_ROM_SLOT 6
#define PCI_NUM_REGIONS 7
-#define PCI_DEVICES_MAX 64
-
/* Declarations from linux/pci_regs.h */
#define PCI_VENDOR_ID 0x00 /* 16 bits */
#define PCI_DEVICE_ID 0x02 /* 16 bits */
PCIConfigReadFunc *config_read;
PCIConfigWriteFunc *config_write;
PCIUnregisterFunc *unregister;
- /* ??? This is a PC-specific hack, and should be removed. */
- int irq_index;
/* IRQ objects for the INTA-INTD pins. */
qemu_irq *irq;