aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-07-21 08:36:37 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-07-21 08:53:35 +0000
commit72f44c8cc73deec56a04156384a2d76b7a3ab82d (patch)
treebec3f16af5235c99015c29cf8ab8d82b1e074fd6 /hw/pci.c
parent0bf9e31af1cc2915c9d250aab0ada0878df897ee (diff)
downloadqemu-72f44c8cc73deec56a04156384a2d76b7a3ab82d.zip
qemu-72f44c8cc73deec56a04156384a2d76b7a3ab82d.tar.gz
qemu-72f44c8cc73deec56a04156384a2d76b7a3ab82d.tar.bz2
Sparc64: convert APB to qdev
Thanks to Igor Kovalenko for a bugfix. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/pci.c b/hw/pci.c
index 3b5a947..b0a2d79 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -145,11 +145,13 @@ PCIBus *pci_register_bus(DeviceState *parent, const char *name,
return bus;
}
-static PCIBus *pci_register_secondary_bus(PCIDevice *dev, pci_map_irq_fn map_irq)
+static PCIBus *pci_register_secondary_bus(PCIDevice *dev,
+ pci_map_irq_fn map_irq,
+ const char *name)
{
PCIBus *bus;
- bus = qemu_mallocz(sizeof(PCIBus));
+ bus = FROM_QBUS(PCIBus, qbus_create(&pci_bus_info, &dev->qdev, name));
bus->map_irq = map_irq;
bus->parent_dev = dev;
bus->next = dev->bus->next;
@@ -891,7 +893,7 @@ PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
PCI_HEADER_TYPE_MULTI_FUNCTION | PCI_HEADER_TYPE_BRIDGE; // header_type
s->dev.config[0x1E] = 0xa0; // secondary status
- s->bus = pci_register_secondary_bus(&s->dev, map_irq);
+ s->bus = pci_register_secondary_bus(&s->dev, map_irq, name);
return s->bus;
}