aboutsummaryrefslogtreecommitdiff
path: root/include/hw/timer
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-11-25 18:13:38 +0100
committerAndreas Färber <afaerber@suse.de>2013-06-07 14:55:24 +0200
commit58cd986422d7353e7fac56969ac59daab3cdca67 (patch)
tree5c7994de97c4052c443bed62f050268a805475c7 /include/hw/timer
parent3afe7e14a42309578d324df5fe1b303a496a8466 (diff)
kvm/i8254: QOM'ify some more
Introduce type constant and cast macro to obsolete DO_UPCAST(). Prepares for PIT realizefn. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include/hw/timer')
-rw-r--r--include/hw/timer/i8254.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h
index 016f990440..434903348c 100644
--- a/include/hw/timer/i8254.h
+++ b/include/hw/timer/i8254.h
@@ -38,6 +38,7 @@ typedef struct PITChannelInfo {
} PITChannelInfo;
#define TYPE_I8254 "isa-pit"
+#define TYPE_KVM_I8254 "kvm-pit"
static inline ISADevice *pit_init(ISABus *bus, int base, int isa_irq,
qemu_irq alt_irq)
@@ -57,13 +58,15 @@ static inline ISADevice *pit_init(ISABus *bus, int base, int isa_irq,
static inline ISADevice *kvm_pit_init(ISABus *bus, int base)
{
- ISADevice *dev;
+ DeviceState *dev;
+ ISADevice *d;
- dev = isa_create(bus, "kvm-pit");
- qdev_prop_set_uint32(&dev->qdev, "iobase", base);
- qdev_init_nofail(&dev->qdev);
+ d = isa_create(bus, TYPE_KVM_I8254);
+ dev = DEVICE(d);
+ qdev_prop_set_uint32(dev, "iobase", base);
+ qdev_init_nofail(dev);
- return dev;
+ return d;
}
void pit_set_gate(ISADevice *dev, int channel, int val);