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/pl110.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/pl110.c')
-rw-r--r-- | hw/pl110.c | 57 |
1 files changed, 39 insertions, 18 deletions
diff --git a/hw/pl110.c b/hw/pl110.c index 0e1f415aeb..58fb9d3597 100644 --- a/hw/pl110.c +++ b/hw/pl110.c @@ -469,28 +469,49 @@ static int pl111_init(SysBusDevice *dev) return pl110_init(dev); } -static SysBusDeviceInfo pl110_info = { - .init = pl110_init, - .qdev.name = "pl110", - .qdev.size = sizeof(pl110_state), - .qdev.vmsd = &vmstate_pl110, - .qdev.no_user = 1, +static void pl110_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = pl110_init; +} + +static DeviceInfo pl110_info = { + .name = "pl110", + .size = sizeof(pl110_state), + .vmsd = &vmstate_pl110, + .no_user = 1, + .class_init = pl110_class_init, }; -static SysBusDeviceInfo pl110_versatile_info = { - .init = pl110_versatile_init, - .qdev.name = "pl110_versatile", - .qdev.size = sizeof(pl110_state), - .qdev.vmsd = &vmstate_pl110, - .qdev.no_user = 1, +static void pl110_versatile_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = pl110_versatile_init; +} + +static DeviceInfo pl110_versatile_info = { + .name = "pl110_versatile", + .size = sizeof(pl110_state), + .vmsd = &vmstate_pl110, + .no_user = 1, + .class_init = pl110_versatile_class_init, }; -static SysBusDeviceInfo pl111_info = { - .init = pl111_init, - .qdev.name = "pl111", - .qdev.size = sizeof(pl110_state), - .qdev.vmsd = &vmstate_pl110, - .qdev.no_user = 1, +static void pl111_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = pl111_init; +} + +static DeviceInfo pl111_info = { + .name = "pl111", + .size = sizeof(pl110_state), + .vmsd = &vmstate_pl110, + .no_user = 1, + .class_init = pl111_class_init, }; static void pl110_register_devices(void) |