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/dec_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/dec_pci.c')
-rw-r--r-- | hw/dec_pci.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/hw/dec_pci.c b/hw/dec_pci.c index 7c3f50e678..f0ecaff07d 100644 --- a/hw/dec_pci.c +++ b/hw/dec_pci.c @@ -84,7 +84,7 @@ PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn) return pci_bridge_get_sec_bus(br); } -static int pci_dec_21154_init_device(SysBusDevice *dev) +static int pci_dec_21154_device_init(SysBusDevice *dev) { DECState *s; @@ -123,11 +123,22 @@ static DeviceInfo dec_21154_pci_host_info = { .class_init = dec_21154_pci_host_class_init, }; -static void dec_register_devices(void) +static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data) { - sysbus_register_dev("dec-21154", sizeof(DECState), - pci_dec_21154_init_device); + SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass); + + sdc->init = pci_dec_21154_device_init; +} + +static DeviceInfo pci_dec_21154_device_info = { + .name = "dec-21154", + .size = sizeof(DECState), + .class_init = pci_dec_21154_device_class_init, +}; +static void dec_register_devices(void) +{ + sysbus_qdev_register(&pci_dec_21154_device_info); pci_qdev_register(&dec_21154_pci_host_info); pci_qdev_register(&dec_21154_pci_bridge_info); } |