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/pxa2xx_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/pxa2xx_timer.c')
-rw-r--r-- | hw/pxa2xx_timer.c | 66 |
1 files changed, 42 insertions, 24 deletions
diff --git a/hw/pxa2xx_timer.c b/hw/pxa2xx_timer.c index 50e26789d2..cd78d41ab4 100644 --- a/hw/pxa2xx_timer.c +++ b/hw/pxa2xx_timer.c @@ -477,32 +477,50 @@ static const VMStateDescription vmstate_pxa2xx_timer_regs = { } }; -static SysBusDeviceInfo pxa25x_timer_dev_info = { - .init = pxa2xx_timer_init, - .qdev.name = "pxa25x-timer", - .qdev.desc = "PXA25x timer", - .qdev.size = sizeof(PXA2xxTimerInfo), - .qdev.vmsd = &vmstate_pxa2xx_timer_regs, - .qdev.props = (Property[]) { - DEFINE_PROP_UINT32("freq", PXA2xxTimerInfo, freq, PXA25X_FREQ), - DEFINE_PROP_BIT("tm4", PXA2xxTimerInfo, flags, - PXA2XX_TIMER_HAVE_TM4, false), - DEFINE_PROP_END_OF_LIST(), - }, +static Property pxa25x_timer_dev_properties[] = { + DEFINE_PROP_UINT32("freq", PXA2xxTimerInfo, freq, PXA25X_FREQ), + DEFINE_PROP_BIT("tm4", PXA2xxTimerInfo, flags, + PXA2XX_TIMER_HAVE_TM4, false), + DEFINE_PROP_END_OF_LIST(), }; -static SysBusDeviceInfo pxa27x_timer_dev_info = { - .init = pxa2xx_timer_init, - .qdev.name = "pxa27x-timer", - .qdev.desc = "PXA27x timer", - .qdev.size = sizeof(PXA2xxTimerInfo), - .qdev.vmsd = &vmstate_pxa2xx_timer_regs, - .qdev.props = (Property[]) { - DEFINE_PROP_UINT32("freq", PXA2xxTimerInfo, freq, PXA27X_FREQ), - DEFINE_PROP_BIT("tm4", PXA2xxTimerInfo, flags, - PXA2XX_TIMER_HAVE_TM4, true), - DEFINE_PROP_END_OF_LIST(), - }, +static void pxa25x_timer_dev_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = pxa2xx_timer_init; +} + +static DeviceInfo pxa25x_timer_dev_info = { + .name = "pxa25x-timer", + .desc = "PXA25x timer", + .size = sizeof(PXA2xxTimerInfo), + .vmsd = &vmstate_pxa2xx_timer_regs, + .props = pxa25x_timer_dev_properties, + .class_init = pxa25x_timer_dev_class_init, +}; + +static Property pxa27x_timer_dev_properties[] = { + DEFINE_PROP_UINT32("freq", PXA2xxTimerInfo, freq, PXA27X_FREQ), + DEFINE_PROP_BIT("tm4", PXA2xxTimerInfo, flags, + PXA2XX_TIMER_HAVE_TM4, true), + DEFINE_PROP_END_OF_LIST(), +}; + +static void pxa27x_timer_dev_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = pxa2xx_timer_init; +} + +static DeviceInfo pxa27x_timer_dev_info = { + .name = "pxa27x-timer", + .desc = "PXA27x timer", + .size = sizeof(PXA2xxTimerInfo), + .vmsd = &vmstate_pxa2xx_timer_regs, + .props = pxa27x_timer_dev_properties, + .class_init = pxa27x_timer_dev_class_init, }; static void pxa2xx_timer_register(void) |