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/pl061.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/pl061.c')
-rw-r--r-- | hw/pl061.c | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/hw/pl061.c b/hw/pl061.c index f33ae84408..9dc9406c28 100644 --- a/hw/pl061.c +++ b/hw/pl061.c @@ -293,18 +293,32 @@ static int pl061_init_arm(SysBusDevice *dev) return pl061_init(dev, pl061_id); } -static SysBusDeviceInfo pl061_info = { - .init = pl061_init_arm, - .qdev.name = "pl061", - .qdev.size = sizeof(pl061_state), - .qdev.vmsd = &vmstate_pl061, +static void pl061_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = pl061_init_arm; +} + +static DeviceInfo pl061_info = { + .name = "pl061", + .size = sizeof(pl061_state), + .vmsd = &vmstate_pl061, + .class_init = pl061_class_init, }; -static SysBusDeviceInfo pl061_luminary_info = { - .init = pl061_init_luminary, - .qdev.name = "pl061_luminary", - .qdev.size = sizeof(pl061_state), - .qdev.vmsd = &vmstate_pl061, +static void pl061_luminary_class_init(ObjectClass *klass, void *data) +{ + SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); + + k->init = pl061_init_luminary; +} + +static DeviceInfo pl061_luminary_info = { + .name = "pl061_luminary", + .size = sizeof(pl061_state), + .vmsd = &vmstate_pl061, + .class_init = pl061_luminary_class_init, }; static void pl061_register_devices(void) |