]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
KVM: Portability: Move kvm{pic,ioapic} accesors to x86 specific code
authorZhang Xiantao <xiantao.zhang@intel.com>
Tue, 11 Dec 2007 12:36:00 +0000 (20:36 +0800)
committerAvi Kivity <avi@qumranet.com>
Wed, 30 Jan 2008 15:53:22 +0000 (17:53 +0200)
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/irq.h
drivers/kvm/kvm.h
drivers/kvm/x86.h

index 730a87c173e59f6672febfd39f046e55be330e99..e88d93957d24066b2dd4666c41d8939ec4b0eb4b 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/hrtimer.h>
 #include <asm/kvm.h>
 #include "iodev.h"
+#include "x86.h"
 
 struct kvm;
 struct kvm_vcpu;
@@ -63,8 +64,6 @@ struct kvm_pic {
 struct kvm_pic *kvm_create_pic(struct kvm *kvm);
 void kvm_pic_set_irq(void *opaque, int irq, int level);
 int kvm_pic_read_irq(struct kvm_pic *s);
-int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
-int kvm_cpu_has_interrupt(struct kvm_vcpu *v);
 void kvm_pic_update_irq(struct kvm_pic *s);
 
 #define IOAPIC_NUM_PINS  KVM_IOAPIC_NUM_PINS
@@ -147,6 +146,21 @@ do {                                                                       \
 #define ASSERT(x) do { } while (0)
 #endif
 
+static inline struct kvm_pic *pic_irqchip(struct kvm *kvm)
+{
+       return kvm->vpic;
+}
+
+static inline struct kvm_ioapic *ioapic_irqchip(struct kvm *kvm)
+{
+       return kvm->vioapic;
+}
+
+static inline int irqchip_in_kernel(struct kvm *kvm)
+{
+       return pic_irqchip(kvm) != NULL;
+}
+
 void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
 int kvm_apic_has_interrupt(struct kvm_vcpu *vcpu);
 int kvm_apic_accept_pic_intr(struct kvm_vcpu *vcpu);
index ceefb4427dbd6eb9f88349693982e176146da927..668a8300365dc25c6f49199b78d8ded0076472f7 100644 (file)
@@ -273,21 +273,6 @@ struct kvm {
        struct kvm_vm_stat stat;
 };
 
-static inline struct kvm_pic *pic_irqchip(struct kvm *kvm)
-{
-       return kvm->vpic;
-}
-
-static inline struct kvm_ioapic *ioapic_irqchip(struct kvm *kvm)
-{
-       return kvm->vioapic;
-}
-
-static inline int irqchip_in_kernel(struct kvm *kvm)
-{
-       return pic_irqchip(kvm) != NULL;
-}
-
 /* The guest did something we don't support. */
 #define pr_unimpl(vcpu, fmt, ...)                                      \
  do {                                                                  \
@@ -417,6 +402,9 @@ void kvm_free_physmem(struct kvm *kvm);
 struct  kvm *kvm_arch_create_vm(void);
 void kvm_arch_destroy_vm(struct kvm *kvm);
 
+int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
+int kvm_cpu_has_interrupt(struct kvm_vcpu *v);
+
 static inline void kvm_guest_enter(void)
 {
        account_system_vtime(current);
index 78396d627be0697118d18bd203ab3e79a6caffc0..0fc7020aa1a5400c4e67437a362f5b7de5fdfd7d 100644 (file)
@@ -12,7 +12,6 @@
 #define KVM_X86_H
 
 #include "kvm.h"
-#include "irq.h"
 
 #include <linux/types.h>
 #include <linux/mm.h>