aboutsummaryrefslogtreecommitdiff
path: root/hw/spitz.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/spitz.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/spitz.c')
-rw-r--r--hw/spitz.c55
1 files changed, 36 insertions, 19 deletions
diff --git a/hw/spitz.c b/hw/spitz.c
index a2a778f77f..046efad637 100644
--- a/hw/spitz.c
+++ b/hw/spitz.c
@@ -1023,16 +1023,25 @@ static VMStateDescription vmstate_sl_nand_info = {
},
};
-static SysBusDeviceInfo sl_nand_info = {
- .init = sl_nand_init,
- .qdev.name = "sl-nand",
- .qdev.size = sizeof(SLNANDState),
- .qdev.vmsd = &vmstate_sl_nand_info,
- .qdev.props = (Property []) {
- DEFINE_PROP_UINT8("manf_id", SLNANDState, manf_id, NAND_MFR_SAMSUNG),
- DEFINE_PROP_UINT8("chip_id", SLNANDState, chip_id, 0xf1),
- DEFINE_PROP_END_OF_LIST(),
- },
+static Property sl_nand_properties[] = {
+ DEFINE_PROP_UINT8("manf_id", SLNANDState, manf_id, NAND_MFR_SAMSUNG),
+ DEFINE_PROP_UINT8("chip_id", SLNANDState, chip_id, 0xf1),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
+static void sl_nand_class_init(ObjectClass *klass, void *data)
+{
+ SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
+
+ k->init = sl_nand_init;
+}
+
+static DeviceInfo sl_nand_info = {
+ .name = "sl-nand",
+ .size = sizeof(SLNANDState),
+ .vmsd = &vmstate_sl_nand_info,
+ .props = sl_nand_properties,
+ .class_init = sl_nand_class_init,
};
static VMStateDescription vmstate_spitz_kbd = {
@@ -1049,14 +1058,23 @@ static VMStateDescription vmstate_spitz_kbd = {
},
};
-static SysBusDeviceInfo spitz_keyboard_info = {
- .init = spitz_keyboard_init,
- .qdev.name = "spitz-keyboard",
- .qdev.size = sizeof(SpitzKeyboardState),
- .qdev.vmsd = &vmstate_spitz_kbd,
- .qdev.props = (Property []) {
- DEFINE_PROP_END_OF_LIST(),
- },
+static Property spitz_keyboard_properties[] = {
+ DEFINE_PROP_END_OF_LIST(),
+};
+
+static void spitz_keyboard_class_init(ObjectClass *klass, void *data)
+{
+ SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
+
+ k->init = spitz_keyboard_init;
+}
+
+static DeviceInfo spitz_keyboard_info = {
+ .name = "spitz-keyboard",
+ .size = sizeof(SpitzKeyboardState),
+ .vmsd = &vmstate_spitz_kbd,
+ .props = spitz_keyboard_properties,
+ .class_init = spitz_keyboard_class_init,
};
static const VMStateDescription vmstate_corgi_ssp_regs = {
@@ -1078,7 +1096,6 @@ static void corgi_ssp_class_init(ObjectClass *klass, void *data)
k->transfer = corgi_ssp_transfer;
}
-
static DeviceInfo corgi_ssp_info = {
.name = "corgi-ssp",
.size = sizeof(CorgiSSPState),