aboutsummaryrefslogtreecommitdiff
path: root/hw/stellaris.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/stellaris.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/stellaris.c')
-rw-r--r--hw/stellaris.c48
1 files changed, 42 insertions, 6 deletions
diff --git a/hw/stellaris.c b/hw/stellaris.c
index a1620cbc28..b91139e179 100644
--- a/hw/stellaris.c
+++ b/hw/stellaris.c
@@ -1408,14 +1408,50 @@ static DeviceInfo stellaris_ssi_bus_info = {
.class_init = stellaris_ssi_bus_class_init,
};
+static void stellaris_i2c_class_init(ObjectClass *klass, void *data)
+{
+ SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
+
+ sdc->init = stellaris_i2c_init;
+}
+
+static DeviceInfo stellaris_i2c_info = {
+ .name = "stellaris-i2c",
+ .size = sizeof(stellaris_i2c_state),
+ .class_init = stellaris_i2c_class_init,
+};
+
+static void stellaris_gptm_class_init(ObjectClass *klass, void *data)
+{
+ SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
+
+ sdc->init = stellaris_gptm_init;
+}
+
+static DeviceInfo stellaris_gptm_info = {
+ .name = "stellaris-gptm",
+ .size = sizeof(gptm_state),
+ .class_init = stellaris_gptm_class_init,
+};
+
+static void stellaris_adc_class_init(ObjectClass *klass, void *data)
+{
+ SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
+
+ sdc->init = stellaris_adc_init;
+}
+
+static DeviceInfo stellaris_adc_info = {
+ .name = "stellaris-adc",
+ .size = sizeof(stellaris_adc_state),
+ .class_init = stellaris_adc_class_init,
+};
+
static void stellaris_register_devices(void)
{
- sysbus_register_dev("stellaris-i2c", sizeof(stellaris_i2c_state),
- stellaris_i2c_init);
- sysbus_register_dev("stellaris-gptm", sizeof(gptm_state),
- stellaris_gptm_init);
- sysbus_register_dev("stellaris-adc", sizeof(stellaris_adc_state),
- stellaris_adc_init);
+ sysbus_qdev_register(&stellaris_i2c_info);
+ sysbus_qdev_register(&stellaris_gptm_info);
+ sysbus_qdev_register(&stellaris_adc_info);
ssi_register_slave(&stellaris_ssi_bus_info);
}