diff options
author | Avi Kivity <avi@redhat.com> | 2011-08-08 16:09:04 +0300 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-08 10:15:53 -0500 |
commit | aee97b840fd0362594c954af750491fafad66a3d (patch) | |
tree | 38d92eebc7f845fece1358ef1aeecf6f9741d138 /hw/pci.c | |
parent | 309cb471c80e5909710d1ee3c3b50d481496d189 (diff) | |
download | qemu-aee97b840fd0362594c954af750491fafad66a3d.tar.gz qemu-aee97b840fd0362594c954af750491fafad66a3d.tar.bz2 qemu-aee97b840fd0362594c954af750491fafad66a3d.zip |
pci: pass I/O address space to new PCI bus
This lets us register BARs in the I/O address space.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pci.c')
-rw-r--r-- | hw/pci.c | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -264,13 +264,14 @@ int pci_find_domain(const PCIBus *bus) void pci_bus_new_inplace(PCIBus *bus, DeviceState *parent, const char *name, - MemoryRegion *address_space, + MemoryRegion *address_space_mem, + MemoryRegion *address_space_io, uint8_t devfn_min) { qbus_create_inplace(&bus->qbus, &pci_bus_info, parent, name); assert(PCI_FUNC(devfn_min) == 0); bus->devfn_min = devfn_min; - bus->address_space = address_space; + bus->address_space = address_space_mem; /* host bridge */ QLIST_INIT(&bus->child); @@ -280,13 +281,16 @@ void pci_bus_new_inplace(PCIBus *bus, DeviceState *parent, } PCIBus *pci_bus_new(DeviceState *parent, const char *name, - MemoryRegion *address_space, uint8_t devfn_min) + MemoryRegion *address_space_mem, + MemoryRegion *address_space_io, + uint8_t devfn_min) { PCIBus *bus; bus = qemu_mallocz(sizeof(*bus)); bus->qbus.qdev_allocated = 1; - pci_bus_new_inplace(bus, parent, name, address_space, devfn_min); + pci_bus_new_inplace(bus, parent, name, address_space_mem, + address_space_io, devfn_min); return bus; } @@ -315,12 +319,14 @@ void pci_bus_set_mem_base(PCIBus *bus, target_phys_addr_t base) PCIBus *pci_register_bus(DeviceState *parent, const char *name, pci_set_irq_fn set_irq, pci_map_irq_fn map_irq, void *irq_opaque, - MemoryRegion *address_space, + MemoryRegion *address_space_mem, + MemoryRegion *address_space_io, uint8_t devfn_min, int nirq) { PCIBus *bus; - bus = pci_bus_new(parent, name, address_space, devfn_min); + bus = pci_bus_new(parent, name, address_space_mem, + address_space_io, devfn_min); pci_bus_irqs(bus, set_irq, map_irq, irq_opaque, nirq); return bus; } |