aboutsummaryrefslogtreecommitdiff
path: root/hw/sh_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/sh_pci.c
parent40021f08882aaef93c66c8c740087b6d3031b63a (diff)
downloadqemu-999e12bbe85c5dcf49bef13bce4f97399c7105f4.zip
qemu-999e12bbe85c5dcf49bef13bce4f97399c7105f4.tar.gz
qemu-999e12bbe85c5dcf49bef13bce4f97399c7105f4.tar.bz2
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/sh_pci.c')
-rw-r--r--hw/sh_pci.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/hw/sh_pci.c b/hw/sh_pci.c
index baeab9e..a849176 100644
--- a/hw/sh_pci.c
+++ b/hw/sh_pci.c
@@ -110,7 +110,7 @@ static void sh_pci_set_irq(void *opaque, int irq_num, int level)
qemu_set_irq(pic[irq_num], level);
}
-static int sh_pci_init_device(SysBusDevice *dev)
+static int sh_pci_device_init(SysBusDevice *dev)
{
SHPCIState *s;
int i;
@@ -162,10 +162,22 @@ static DeviceInfo sh_pci_host_info = {
.class_init = sh_pci_host_class_init,
};
+static void sh_pci_device_class_init(ObjectClass *klass, void *data)
+{
+ SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
+
+ sdc->init = sh_pci_device_init;
+}
+
+static DeviceInfo sh_pci_device_info = {
+ .name = "sh_pci",
+ .size = sizeof(SHPCIState),
+ .class_init = sh_pci_device_class_init,
+};
+
static void sh_pci_register_devices(void)
{
- sysbus_register_dev("sh_pci", sizeof(SHPCIState),
- sh_pci_init_device);
+ sysbus_qdev_register(&sh_pci_device_info);
pci_qdev_register(&sh_pci_host_info);
}