aboutsummaryrefslogtreecommitdiff
path: root/hw/arm_mptimer.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-01-24 13:12:29 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:50 -0600
commit999e12bbe85c5dcf49bef13bce4f97399c7105f4 (patch)
tree73b6ed8633a73134e9f728baa1ed2b1dab58b5b0 /hw/arm_mptimer.c
parent40021f08882aaef93c66c8c740087b6d3031b63a (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_mptimer.c')
-rw-r--r--hw/arm_mptimer.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/hw/arm_mptimer.c b/hw/arm_mptimer.c
index 455a0aa55a..06319c2e14 100644
--- a/hw/arm_mptimer.c
+++ b/hw/arm_mptimer.c
@@ -311,14 +311,21 @@ static const VMStateDescription vmstate_arm_mptimer = {
}
};
-static SysBusDeviceInfo arm_mptimer_info = {
- .init = arm_mptimer_init,
- .qdev.name = "arm_mptimer",
- .qdev.size = sizeof(arm_mptimer_state),
- .qdev.vmsd = &vmstate_arm_mptimer,
- .qdev.reset = arm_mptimer_reset,
- .qdev.no_user = 1,
- .qdev.props = (Property[]) {
+static void arm_mptimer_class_init(ObjectClass *klass, void *data)
+{
+ SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+
+ sbc->init = arm_mptimer_init;
+}
+
+static DeviceInfo arm_mptimer_info = {
+ .name = "arm_mptimer",
+ .size = sizeof(arm_mptimer_state),
+ .vmsd = &vmstate_arm_mptimer,
+ .reset = arm_mptimer_reset,
+ .no_user = 1,
+ .class_init = arm_mptimer_class_init,
+ .props = (Property[]) {
DEFINE_PROP_UINT32("num-cpu", arm_mptimer_state, num_cpu, 0),
DEFINE_PROP_END_OF_LIST()
}