diff options
author | Zhang Xiantao <xiantao.zhang@intel.com> | 2007-12-17 00:59:56 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 11:01:19 -0500 |
commit | 82470196fa346f50ab4071935597017de33c9ee3 (patch) | |
tree | 2dc26c39f17d13555badb8e451c2d6fbe80902ec /arch/x86/kvm/lapic.h | |
parent | 0fce5623ba248d3af0d7fb719d5ac367cc9d5192 (diff) |
KVM: Move irqchip declarations into new ioapic.h and lapic.h
This allows reuse of ioapic in ia64.
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/lapic.h')
-rw-r--r-- | arch/x86/kvm/lapic.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h new file mode 100644 index 000000000000..447b654aefbb --- /dev/null +++ b/arch/x86/kvm/lapic.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #ifndef __KVM_X86_LAPIC_H | ||
2 | #define __KVM_X86_LAPIC_H | ||
3 | |||
4 | #include "iodev.h" | ||
5 | |||
6 | #include <linux/kvm_host.h> | ||
7 | |||
8 | struct kvm_lapic { | ||
9 | unsigned long base_address; | ||
10 | struct kvm_io_device dev; | ||
11 | struct { | ||
12 | atomic_t pending; | ||
13 | s64 period; /* unit: ns */ | ||
14 | u32 divide_count; | ||
15 | ktime_t last_update; | ||
16 | struct hrtimer dev; | ||
17 | } timer; | ||
18 | struct kvm_vcpu *vcpu; | ||
19 | struct page *regs_page; | ||
20 | void *regs; | ||
21 | }; | ||
22 | int kvm_create_lapic(struct kvm_vcpu *vcpu); | ||
23 | void kvm_free_lapic(struct kvm_vcpu *vcpu); | ||
24 | |||
25 | int kvm_apic_has_interrupt(struct kvm_vcpu *vcpu); | ||
26 | int kvm_apic_accept_pic_intr(struct kvm_vcpu *vcpu); | ||
27 | int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu); | ||
28 | void kvm_lapic_reset(struct kvm_vcpu *vcpu); | ||
29 | u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu); | ||
30 | void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8); | ||
31 | void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value); | ||
32 | |||
33 | int kvm_apic_match_physical_addr(struct kvm_lapic *apic, u16 dest); | ||
34 | int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u8 mda); | ||
35 | int kvm_apic_set_irq(struct kvm_vcpu *vcpu, u8 vec, u8 trig); | ||
36 | |||
37 | u64 kvm_get_apic_base(struct kvm_vcpu *vcpu); | ||
38 | void kvm_set_apic_base(struct kvm_vcpu *vcpu, u64 data); | ||
39 | void kvm_apic_post_state_restore(struct kvm_vcpu *vcpu); | ||
40 | int kvm_lapic_enabled(struct kvm_vcpu *vcpu); | ||
41 | int kvm_lapic_find_highest_irr(struct kvm_vcpu *vcpu); | ||
42 | void kvm_apic_timer_intr_post(struct kvm_vcpu *vcpu, int vec); | ||
43 | |||
44 | #endif | ||