aboutsummaryrefslogtreecommitdiff
path: root/hw/i8254.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-04 11:52:49 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:47 -0600
commit8f04ee0882aec9fe91fb70f767edf5dacff59835 (patch)
tree01ebc9678569233858c2343c9cb04e62c2df55ad /hw/i8254.c
parente855761ca8fa08ebe29c1e69abc6f0863a453f92 (diff)
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/i8254.c')
-rw-r--r--hw/i8254.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/hw/i8254.c b/hw/i8254.c
index cf9ed2ff25..add1fabefe 100644
--- a/hw/i8254.c
+++ b/hw/i8254.c
@@ -535,14 +535,20 @@ static int pit_initfn(ISADevice *dev)
return 0;
}
-static ISADeviceInfo pit_info = {
- .qdev.name = "isa-pit",
- .qdev.size = sizeof(PITState),
- .qdev.vmsd = &vmstate_pit,
- .qdev.reset = pit_reset,
- .qdev.no_user = 1,
- .init = pit_initfn,
- .qdev.props = (Property[]) {
+static void pit_class_initfn(ObjectClass *klass, void *data)
+{
+ ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
+ ic->init = pit_initfn;
+}
+
+static DeviceInfo pit_info = {
+ .name = "isa-pit",
+ .size = sizeof(PITState),
+ .vmsd = &vmstate_pit,
+ .reset = pit_reset,
+ .no_user = 1,
+ .class_init = pit_class_initfn,
+ .props = (Property[]) {
DEFINE_PROP_UINT32("irq", PITState, irq, -1),
DEFINE_PROP_HEX32("iobase", PITState, iobase, -1),
DEFINE_PROP_END_OF_LIST(),