summaryrefslogtreecommitdiffstats
path: root/include/hw/timer/i8254.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hw/timer/i8254.h')
-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);