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/slavio_timer.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/slavio_timer.c')
-rw-r--r-- | hw/slavio_timer.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/hw/slavio_timer.c b/hw/slavio_timer.c index 44b500a5fa..a3bebcd3cf 100644 --- a/hw/slavio_timer.c +++ b/hw/slavio_timer.c @@ -404,16 +404,25 @@ static int slavio_timer_init1(SysBusDevice *dev) return 0; } -static SysBusDeviceInfo slavio_timer_info = { - .init = slavio_timer_init1, - .qdev.name = "slavio_timer", - .qdev.size = sizeof(SLAVIO_TIMERState), - .qdev.vmsd = &vmstate_slavio_timer, - .qdev.reset = slavio_timer_reset, - .qdev.props = (Property[]) { - DEFINE_PROP_UINT32("num_cpus", SLAVIO_TIMERState, num_cpus, 0), - DEFINE_PROP_END_OF_LIST(), - } +static Property slavio_timer_properties[] = { + DEFINE_PROP_UINT32("num_cpus", SLAVIO_TIMERState, num_cpus, 0), + DEFINE_PROP_END_OF_LIST(), +}; + +static void slavio_timer_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = slavio_timer_init1; +} + +static DeviceInfo slavio_timer_info = { + .name = "slavio_timer", + .size = sizeof(SLAVIO_TIMERState), + .vmsd = &vmstate_slavio_timer, + .reset = slavio_timer_reset, + .props = slavio_timer_properties, + .class_init = slavio_timer_class_init, }; static void slavio_timer_register_devices(void) |