aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/lapic.h
diff options
context:
space:
mode:
authorZhang Xiantao <xiantao.zhang@intel.com>2007-12-17 00:59:56 -0500
committerAvi Kivity <avi@qumranet.com>2008-01-30 11:01:19 -0500
commit82470196fa346f50ab4071935597017de33c9ee3 (patch)
tree2dc26c39f17d13555badb8e451c2d6fbe80902ec /arch/x86/kvm/lapic.h
parent0fce5623ba248d3af0d7fb719d5ac367cc9d5192 (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.h44
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
8struct 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};
22int kvm_create_lapic(struct kvm_vcpu *vcpu);
23void kvm_free_lapic(struct kvm_vcpu *vcpu);
24
25int kvm_apic_has_interrupt(struct kvm_vcpu *vcpu);
26int kvm_apic_accept_pic_intr(struct kvm_vcpu *vcpu);
27int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu);
28void kvm_lapic_reset(struct kvm_vcpu *vcpu);
29u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu);
30void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8);
31void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value);
32
33int kvm_apic_match_physical_addr(struct kvm_lapic *apic, u16 dest);
34int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u8 mda);
35int kvm_apic_set_irq(struct kvm_vcpu *vcpu, u8 vec, u8 trig);
36
37u64 kvm_get_apic_base(struct kvm_vcpu *vcpu);
38void kvm_set_apic_base(struct kvm_vcpu *vcpu, u64 data);
39void kvm_apic_post_state_restore(struct kvm_vcpu *vcpu);
40int kvm_lapic_enabled(struct kvm_vcpu *vcpu);
41int kvm_lapic_find_highest_irr(struct kvm_vcpu *vcpu);
42void kvm_apic_timer_intr_post(struct kvm_vcpu *vcpu, int vec);
43
44#endif