aboutsummaryrefslogtreecommitdiff
path: root/hw/i8254.h
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-03-02 20:28:49 +0100
committerAvi Kivity <avi@redhat.com>2012-03-07 12:27:43 +0200
commit5d17c0d2df4998598e6002b27b8e47e792899a0f (patch)
tree0615a78c68059aa79cc2c3663d954630e097b508 /hw/i8254.h
parent8a7c73932e03f13f29dea8622e15f1ded478d407 (diff)
kvm: x86: Add user space part for in-kernel i8254
This provides the required user space stubs to enable the in-kernel i8254 emulation of KVM. The in-kernel model supports lost tick compensation according to the "delay" policy. This is enabled by default and can be switched off via a device property. Depending on the feature set of the host kernel (before 2.6.32), we may have to disable the HPET or lack sound output from the PC speaker. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/i8254.h')
-rw-r--r--hw/i8254.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/i8254.h b/hw/i8254.h
index a1d2e9835b..ba6b598a99 100644
--- a/hw/i8254.h
+++ b/hw/i8254.h
@@ -51,6 +51,17 @@ static inline ISADevice *pit_init(ISABus *bus, int base, int isa_irq,
return dev;
}
+static inline ISADevice *kvm_pit_init(ISABus *bus, int base)
+{
+ ISADevice *dev;
+
+ dev = isa_create(bus, "kvm-pit");
+ qdev_prop_set_uint32(&dev->qdev, "iobase", base);
+ qdev_init_nofail(&dev->qdev);
+
+ return dev;
+}
+
void pit_set_gate(ISADevice *dev, int channel, int val);
void pit_get_channel_info(ISADevice *dev, int channel, PITChannelInfo *info);