diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-07 21:34:16 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-02-03 10:41:06 -0600 |
commit | 39bffca2030950ef6efe57c2fac8327a45ae1015 (patch) | |
tree | 325262f44978e6116c9e43f688c900e08ee83738 /hw/i82378.c | |
parent | 212ad111683a5b5a79a74d6141a4b75f532a4c8f (diff) | |
download | hqemu-39bffca2030950ef6efe57c2fac8327a45ae1015.zip hqemu-39bffca2030950ef6efe57c2fac8327a45ae1015.tar.gz |
qdev: register all types natively through QEMU Object Model
This was done in a mostly automated fashion. I did it in three steps and then
rebased it into a single step which avoids repeatedly touching every file in
the tree.
The first step was a sed-based addition of the parent type to the subclass
registration functions.
The second step was another sed-based removal of subclass registration functions
while also adding virtual functions from the base class into a class_init
function as appropriate.
Finally, a python script was used to convert the DeviceInfo structures and
qdev_register_subclass functions to TypeInfo structures, class_init functions,
and type_register_static calls.
We are almost fully converted to QOM after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/i82378.c')
-rw-r--r-- | hw/i82378.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/hw/i82378.c b/hw/i82378.c index 99b453a..9c3efe8 100644 --- a/hw/i82378.c +++ b/hw/i82378.c @@ -238,9 +238,16 @@ static int pci_i82378_init(PCIDevice *dev) return 0; } +static Property i82378_properties[] = { + DEFINE_PROP_HEX32("iobase", PCIi82378State, isa_io_base, 0x80000000), + DEFINE_PROP_HEX32("membase", PCIi82378State, isa_mem_base, 0xc0000000), + DEFINE_PROP_END_OF_LIST() +}; + static void pci_i82378_class_init(ObjectClass *klass, void *data) { PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + DeviceClass *dc = DEVICE_CLASS(klass); k->init = pci_i82378_init; k->vendor_id = PCI_VENDOR_ID_INTEL; @@ -249,23 +256,20 @@ static void pci_i82378_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_BRIDGE_ISA; k->subsystem_vendor_id = 0x0; k->subsystem_id = 0x0; + dc->vmsd = &vmstate_pci_i82378; + dc->props = i82378_properties; } -static DeviceInfo pci_i82378_info = { +static TypeInfo pci_i82378_info = { .name = "i82378", - .size = sizeof(PCIi82378State), - .vmsd = &vmstate_pci_i82378, + .parent = TYPE_PCI_DEVICE, + .instance_size = sizeof(PCIi82378State), .class_init = pci_i82378_class_init, - .props = (Property[]) { - DEFINE_PROP_HEX32("iobase", PCIi82378State, isa_io_base, 0x80000000), - DEFINE_PROP_HEX32("membase", PCIi82378State, isa_mem_base, 0xc0000000), - DEFINE_PROP_END_OF_LIST() - }, }; static void i82378_register_devices(void) { - pci_qdev_register(&pci_i82378_info); + type_register_static(&pci_i82378_info); } device_init(i82378_register_devices) |