From 999e12bbe85c5dcf49bef13bce4f97399c7105f4 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Tue, 24 Jan 2012 13:12:29 -0600 Subject: 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 --- hw/versatile_pci.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'hw/versatile_pci.c') 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); } -- cgit v1.2.3