diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-24 13:12:29 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:50 -0600 |
commit | 999e12bbe85c5dcf49bef13bce4f97399c7105f4 (patch) | |
tree | 73b6ed8633a73134e9f728baa1ed2b1dab58b5b0 /hw/versatile_pci.c | |
parent | 40021f08882aaef93c66c8c740087b6d3031b63a (diff) |
sysbus: apic: ioapic: convert to QEMU Object Model
This converts three devices because apic and ioapic are subclasses of sysbus.
Converting subclasses independently of their base class is prohibitively hard.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/versatile_pci.c')
-rw-r--r-- | hw/versatile_pci.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/hw/versatile_pci.c b/hw/versatile_pci.c index 0eb7d3297a..c2eb4dda75 100644 --- a/hw/versatile_pci.c +++ b/hw/versatile_pci.c @@ -125,11 +125,36 @@ static DeviceInfo versatile_pci_host_info = { .class_init = versatile_pci_host_class_init, }; +static void pci_vpb_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass); + + sdc->init = pci_vpb_init; +} + +static DeviceInfo pci_vpb_info = { + .name = "versatile_pci", + .size = sizeof(PCIVPBState), + .class_init = pci_vpb_class_init, +}; + +static void pci_realview_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass); + + sdc->init = pci_realview_init; +} + +static DeviceInfo pci_realview_info = { + .name = "realview_pci", + .size = sizeof(PCIVPBState), + .class_init = pci_realview_class_init, +}; + static void versatile_pci_register_devices(void) { - sysbus_register_dev("versatile_pci", sizeof(PCIVPBState), pci_vpb_init); - sysbus_register_dev("realview_pci", sizeof(PCIVPBState), - pci_realview_init); + sysbus_qdev_register(&pci_vpb_info); + sysbus_qdev_register(&pci_realview_info); pci_qdev_register(&versatile_pci_host_info); } |