aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/irq.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/kvm/irq.h')
-rw-r--r--drivers/kvm/irq.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h
index bdb2fc34804b..57e23bdac530 100644
--- a/drivers/kvm/irq.h
+++ b/drivers/kvm/irq.h
@@ -26,7 +26,6 @@
26 26
27typedef void irq_request_func(void *opaque, int level); 27typedef void irq_request_func(void *opaque, int level);
28 28
29struct kvm_pic;
30struct kvm_kpic_state { 29struct kvm_kpic_state {
31 u8 last_irr; /* edge detection */ 30 u8 last_irr; /* edge detection */
32 u8 irr; /* interrupt request register */ 31 u8 irr; /* interrupt request register */
@@ -61,4 +60,44 @@ int kvm_pic_read_irq(struct kvm_pic *s);
61int kvm_cpu_get_interrupt(struct kvm_vcpu *v); 60int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
62int kvm_cpu_has_interrupt(struct kvm_vcpu *v); 61int kvm_cpu_has_interrupt(struct kvm_vcpu *v);
63 62
63struct kvm_lapic {
64 unsigned long base_address;
65 struct kvm_io_device dev;
66 struct {
67 atomic_t pending;
68 s64 period; /* unit: ns */
69 u32 divide_count;
70 ktime_t last_update;
71 struct hrtimer dev;
72 } timer;
73 struct kvm_vcpu *vcpu;
74 struct page *regs_page;
75 void *regs;
76};
77
78#ifdef DEBUG
79#define ASSERT(x) \
80do { \
81 if (!(x)) { \
82 printk(KERN_EMERG "assertion failed %s: %d: %s\n", \
83 __FILE__, __LINE__, #x); \
84 BUG(); \
85 } \
86} while (0)
87#else
88#define ASSERT(x) do { } while (0)
89#endif
90
91void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
92int kvm_apic_has_interrupt(struct kvm_vcpu *vcpu);
93int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu);
94int kvm_create_lapic(struct kvm_vcpu *vcpu);
95void kvm_free_apic(struct kvm_lapic *apic);
96u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu);
97void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8);
98void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value);
99u64 kvm_get_apic_base(struct kvm_vcpu *vcpu);
100void kvm_set_apic_base(struct kvm_vcpu *vcpu, u64 data);
101void kvm_ioapic_update_eoi(struct kvm *kvm, int vector);
102
64#endif 103#endif