From 682c59a3f3f211ed555b17144f2d82eb8286a1db Mon Sep 17 00:00:00 2001 From: Zhang Xiantao Date: Tue, 11 Dec 2007 20:36:00 +0800 Subject: KVM: Portability: Move kvm{pic,ioapic} accesors to x86 specific code Signed-off-by: Zhang Xiantao Signed-off-by: Avi Kivity --- drivers/kvm/irq.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'drivers/kvm/irq.h') diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h index 730a87c173e..e88d93957d2 100644 --- a/drivers/kvm/irq.h +++ b/drivers/kvm/irq.h @@ -26,6 +26,7 @@ #include #include #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); -- cgit v1.2.2