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/arm_l2x0.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/arm_l2x0.c')
-rw-r--r-- | hw/arm_l2x0.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/hw/arm_l2x0.c b/hw/arm_l2x0.c index 2faed39f0f..7c5fe32fc5 100644 --- a/hw/arm_l2x0.c +++ b/hw/arm_l2x0.c @@ -160,22 +160,29 @@ static int l2x0_priv_init(SysBusDevice *dev) return 0; } -static SysBusDeviceInfo l2x0_info = { - .init = l2x0_priv_init, - .qdev.name = "l2x0", - .qdev.size = sizeof(l2x0_state), - .qdev.vmsd = &vmstate_l2x0, - .qdev.no_user = 1, - .qdev.props = (Property[]) { +static void l2x0_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = l2x0_priv_init; +} + +static DeviceInfo l2x0_info = { + .name = "l2x0", + .size = sizeof(l2x0_state), + .vmsd = &vmstate_l2x0, + .no_user = 1, + .props = (Property[]) { DEFINE_PROP_UINT32("type", l2x0_state, cache_type, 0x1c100100), DEFINE_PROP_END_OF_LIST(), }, - .qdev.reset = l2x0_priv_reset, + .reset = l2x0_priv_reset, + .class_init = l2x0_class_init, }; static void l2x0_register_device(void) { - sysbus_register_withprop(&l2x0_info); + sysbus_qdev_register(&l2x0_info); } device_init(l2x0_register_device) |