aboutsummaryrefslogtreecommitdiff
path: root/hw/unin_pci.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/unin_pci.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/unin_pci.c')
-rw-r--r--hw/unin_pci.c72
1 files changed, 49 insertions, 23 deletions
diff --git a/hw/unin_pci.c b/hw/unin_pci.c
index 6a148e0ed4..2b394c0180 100644
--- a/hw/unin_pci.c
+++ b/hw/unin_pci.c
@@ -407,43 +407,69 @@ static DeviceInfo unin_internal_pci_host_info = {
.class_init = unin_internal_pci_host_class_init,
};
-static SysBusDeviceInfo sysbus_unin_pci_host_info = {
- .qdev.name = "uni-north-pci-pcihost",
- .qdev.size = sizeof(UNINState),
- .init = pci_unin_main_init_device,
+static void pci_unin_main_class_init(ObjectClass *klass, void *data)
+{
+ SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+
+ sbc->init = pci_unin_main_init_device;
+}
+
+static DeviceInfo pci_unin_main_info = {
+ .name = "uni-north-pci-pchost",
+ .size = sizeof(UNINState),
+ .class_init = pci_unin_main_class_init,
};
-static SysBusDeviceInfo sysbus_u3_agp_pci_host_info = {
- .qdev.name = "u3-agp-pcihost",
- .qdev.size = sizeof(UNINState),
- .init = pci_u3_agp_init_device,
+static void pci_u3_agp_class_init(ObjectClass *klass, void *data)
+{
+ SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+
+ sbc->init = pci_u3_agp_init_device;
+}
+
+static DeviceInfo pci_u3_agp_info = {
+ .name = "u3-agp-pcihost",
+ .size = sizeof(UNINState),
+ .class_init = pci_u3_agp_class_init,
};
-static SysBusDeviceInfo sysbus_unin_agp_pci_host_info = {
- .qdev.name = "uni-north-agp-pcihost",
- .qdev.size = sizeof(UNINState),
- .init = pci_unin_agp_init_device,
+static void pci_unin_agp_class_init(ObjectClass *klass, void *data)
+{
+ SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+
+ sbc->init = pci_unin_agp_init_device;
+}
+
+static DeviceInfo pci_unin_agp_info = {
+ .name = "uni-north-agp-pcihost",
+ .size = sizeof(UNINState),
+ .class_init = pci_unin_agp_class_init,
};
-static SysBusDeviceInfo sysbus_unin_internal_pci_host_info = {
- .qdev.name = "uni-north-internal-pci-pcihost",
- .qdev.size = sizeof(UNINState),
- .init = pci_unin_internal_init_device,
+static void pci_unin_internal_class_init(ObjectClass *klass, void *data)
+{
+ SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+
+ sbc->init = pci_unin_internal_init_device;
+}
+
+static DeviceInfo pci_unin_internal_info = {
+ .name = "uni-north-internal-pci-pichost",
+ .size = sizeof(UNINState),
+ .class_init = pci_unin_internal_class_init,
};
static void unin_register_devices(void)
{
- sysbus_register_withprop(&sysbus_unin_pci_host_info);
pci_qdev_register(&unin_main_pci_host_info);
-
- sysbus_register_withprop(&sysbus_u3_agp_pci_host_info);
pci_qdev_register(&u3_agp_pci_host_info);
-
- sysbus_register_withprop(&sysbus_unin_agp_pci_host_info);
pci_qdev_register(&unin_agp_pci_host_info);
-
- sysbus_register_withprop(&sysbus_unin_internal_pci_host_info);
pci_qdev_register(&unin_internal_pci_host_info);
+
+ sysbus_register_withprop(&pci_unin_main_info);
+ sysbus_register_withprop(&pci_u3_agp_info);
+ sysbus_register_withprop(&pci_unin_agp_info);
+ sysbus_register_withprop(&pci_unin_internal_info);
}
device_init(unin_register_devices)