Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
i8254.h
Go to the documentation of this file.
1 #ifndef __I8254_H
2 #define __I8254_H
3 
4 #include <linux/kthread.h>
5 
6 #include "iodev.h"
7 
9  u32 count; /* can be 65536 */
19  u8 bcd; /* not supported */
20  u8 gate; /* timer start */
22 };
23 
28  s64 period; /* unit: ns */
29  struct hrtimer timer;
30  atomic_t pending; /* accumulated triggered timers */
31  bool reinject;
32  struct kvm *kvm;
34  struct mutex lock;
35  struct kvm_pit *pit;
37  unsigned long irq_ack;
39 };
40 
41 struct kvm_pit {
44  struct kvm *kvm;
51 };
52 
53 #define KVM_PIT_BASE_ADDRESS 0x40
54 #define KVM_SPEAKER_BASE_ADDRESS 0x61
55 #define KVM_PIT_MEM_LENGTH 4
56 #define KVM_PIT_FREQ 1193181
57 #define KVM_MAX_PIT_INTR_INTERVAL HZ / 100
58 #define KVM_PIT_CHANNEL_MASK 0x3
59 
60 void kvm_pit_load_count(struct kvm *kvm, int channel, u32 val, int hpet_legacy_start);
61 struct kvm_pit *kvm_create_pit(struct kvm *kvm, u32 flags);
62 void kvm_free_pit(struct kvm *kvm);
63 void kvm_pit_reset(struct kvm_pit *pit);
64 
65 #endif