diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-04 11:52:49 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:47 -0600 |
commit | 8f04ee0882aec9fe91fb70f767edf5dacff59835 (patch) | |
tree | 01ebc9678569233858c2343c9cb04e62c2df55ad /hw/sb16.c | |
parent | e855761ca8fa08ebe29c1e69abc6f0863a453f92 (diff) | |
download | qemu-8f04ee0882aec9fe91fb70f767edf5dacff59835.zip qemu-8f04ee0882aec9fe91fb70f767edf5dacff59835.tar.gz qemu-8f04ee0882aec9fe91fb70f767edf5dacff59835.tar.bz2 |
isa: pic: convert to QEMU Object Model
This converts two devices at once because PIC subclasses ISA and converting
subclasses independently is extremely hard.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/sb16.c')
-rw-r--r-- | hw/sb16.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -1391,13 +1391,19 @@ int SB16_init (ISABus *bus) return 0; } -static ISADeviceInfo sb16_info = { - .qdev.name = "sb16", - .qdev.desc = "Creative Sound Blaster 16", - .qdev.size = sizeof (SB16State), - .qdev.vmsd = &vmstate_sb16, - .init = sb16_initfn, - .qdev.props = (Property[]) { +static void sb16_class_initfn(ObjectClass *klass, void *data) +{ + ISADeviceClass *ic = ISA_DEVICE_CLASS(klass); + ic->init = sb16_initfn; +} + +static DeviceInfo sb16_info = { + .name = "sb16", + .desc = "Creative Sound Blaster 16", + .size = sizeof (SB16State), + .vmsd = &vmstate_sb16, + .class_init = sb16_class_initfn, + .props = (Property[]) { DEFINE_PROP_HEX32 ("version", SB16State, ver, 0x0405), /* 4.5 */ DEFINE_PROP_HEX32 ("iobase", SB16State, port, 0x220), DEFINE_PROP_UINT32 ("irq", SB16State, irq, 5), |