diff options
Diffstat (limited to 'drivers/kvm/irq.h')
-rw-r--r-- | drivers/kvm/irq.h | 41 |
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 | ||
27 | typedef void irq_request_func(void *opaque, int level); | 27 | typedef void irq_request_func(void *opaque, int level); |
28 | 28 | ||
29 | struct kvm_pic; | ||
30 | struct kvm_kpic_state { | 29 | struct 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); | |||
61 | int kvm_cpu_get_interrupt(struct kvm_vcpu *v); | 60 | int kvm_cpu_get_interrupt(struct kvm_vcpu *v); |
62 | int kvm_cpu_has_interrupt(struct kvm_vcpu *v); | 61 | int kvm_cpu_has_interrupt(struct kvm_vcpu *v); |
63 | 62 | ||
63 | struct 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) \ | ||
80 | do { \ | ||
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 | |||
91 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); | ||
92 | int kvm_apic_has_interrupt(struct kvm_vcpu *vcpu); | ||
93 | int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu); | ||
94 | int kvm_create_lapic(struct kvm_vcpu *vcpu); | ||
95 | void kvm_free_apic(struct kvm_lapic *apic); | ||
96 | u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu); | ||
97 | void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8); | ||
98 | void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value); | ||
99 | u64 kvm_get_apic_base(struct kvm_vcpu *vcpu); | ||
100 | void kvm_set_apic_base(struct kvm_vcpu *vcpu, u64 data); | ||
101 | void kvm_ioapic_update_eoi(struct kvm *kvm, int vector); | ||
102 | |||
64 | #endif | 103 | #endif |