diff options
author | Robert Mustacchi <rm@joyent.com> | 2011-06-06 10:09:46 -0700 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2011-06-06 10:09:46 -0700 |
commit | 801bbc8943e1dc9498ea033e11416b9f8e4f862f (patch) | |
tree | f602c201c40283852b09fa5a880f8c96dbe59935 | |
parent | 1662d9d57f26a6bb37f716089871f6809ed78eeb (diff) | |
download | illumos-kvm-801bbc8943e1dc9498ea033e11416b9f8e4f862f.tar.gz |
HVM-291 irq.h should be kvm_irq.h
HVM-292 kvm_irq.c shouldn't have extern declarations
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | kvm.c | 2 | ||||
-rw-r--r-- | kvm_cache_regs.c | 2 | ||||
-rw-r--r-- | kvm_coalesced_mmio.c | 2 | ||||
-rw-r--r-- | kvm_i8254.c | 2 | ||||
-rw-r--r-- | kvm_i8259.c | 2 | ||||
-rw-r--r-- | kvm_ioapic.c | 2 | ||||
-rw-r--r-- | kvm_irq.c | 36 | ||||
-rw-r--r-- | kvm_irq.h (renamed from irq.h) | 17 | ||||
-rw-r--r-- | kvm_irq_comm.c | 2 | ||||
-rw-r--r-- | kvm_lapic.c | 2 | ||||
-rw-r--r-- | kvm_mmu.c | 2 | ||||
-rw-r--r-- | kvm_vmx.c | 2 | ||||
-rw-r--r-- | kvm_x86.c | 16 |
14 files changed, 39 insertions, 52 deletions
@@ -9,7 +9,7 @@ LD=/usr/bin/ld CTFCONVERT=$(KERNEL_SOURCE)/usr/src/tools/ctf/cvt/i386/ctfconvert CTFMERGE=$(KERNEL_SOURCE)/usr/src/tools/ctf/cvt/i386/ctfmerge DESTDIR= -CFLAGS += -DCONFIG_HAVE_KVM_IRQCHIP -D__KVM_HAVE_IOAPIC -DCONFIG_X86_64 -DCONFIG_X86 -D_KERNEL -D_MACHDEP -Dx86 -DDEBUG -c -g -DCONFIG_SOLARIS -DCONFIG_KVM_MMIO -DCONFIG_KVM_APIC_ARCHITECTURE -DCONFIG_HAVE_KVM_IRQCHIP -O2 -fident -fno-inline -fno-inline-functions -fno-builtin -fno-asm -nodefaultlibs -D__sun -O -D_ASM_INLINES -ffreestanding -Wall -Wno-unknown-pragmas -Wpointer-arith -Wno-unused -gdwarf-2 -std=gnu99 -fno-dwarf2-indirect-strings -Werror -DDIS_MEM -D_KERNEL -ffreestanding -D_SYSCALL32 -D_DDI_STRICT -Di86pc -D_MACHDEP -DOPTERON_ERRATUM_88 -DOPTERON_ERRATUM_91 -DOPTERON_ERRATUM_93 -DOPTERON_ERRATUM_95 -DOPTERON_ERRATUM_99 -DOPTERON_ERRATUM_100 -DOPTERON_ERRATUM_101 -DOPTERON_ERRATUM_108 -DOPTERON_ERRATUM_109 -DOPTERON_ERRATUM_121 -DOPTERON_ERRATUM_122 -DOPTERON_ERRATUM_123 -DOPTERON_ERRATUM_131 -DOPTERON_WORKAROUND_6336786 -DOPTERON_WORKAROUND_6323525 -DOPTERON_ERRATUM_172 -DOPTERON_ERRATUM_298 -I$(KERNEL_SOURCE)/usr/src/uts/common -nostdinc -c -DUTS_RELEASE="5.11" -DUTS_VERSION="joyent.147" -DUTS_PLATFORM="i86pc" -mno-red-zone +CFLAGS += -DCONFIG_HAVE_KVM_IRQCHIP -D__KVM_HAVE_IOAPIC -DCONFIG_X86_64 -DCONFIG_X86 -D_KERNEL -D_MACHDEP -Dx86 -DDEBUG -c -g -DCONFIG_SOLARIS -DCONFIG_KVM_MMIO -DCONFIG_KVM_APIC_ARCHITECTURE -DCONFIG_HAVE_KVM_IRQCHIP -O2 -fident -fno-inline -fno-inline-functions -fno-builtin -fno-asm -nodefaultlibs -D__sun -O -D_ASM_INLINES -ffreestanding -Wall -Wno-unknown-pragmas -Wpointer-arith -Wno-unused -gdwarf-2 -std=c99 -fms-extensions -fno-dwarf2-indirect-strings -Werror -DDIS_MEM -D_KERNEL -ffreestanding -D_SYSCALL32 -D_DDI_STRICT -Di86pc -D_MACHDEP -DOPTERON_ERRATUM_88 -DOPTERON_ERRATUM_91 -DOPTERON_ERRATUM_93 -DOPTERON_ERRATUM_95 -DOPTERON_ERRATUM_99 -DOPTERON_ERRATUM_100 -DOPTERON_ERRATUM_101 -DOPTERON_ERRATUM_108 -DOPTERON_ERRATUM_109 -DOPTERON_ERRATUM_121 -DOPTERON_ERRATUM_122 -DOPTERON_ERRATUM_123 -DOPTERON_ERRATUM_131 -DOPTERON_WORKAROUND_6336786 -DOPTERON_WORKAROUND_6323525 -DOPTERON_ERRATUM_172 -DOPTERON_ERRATUM_298 -I$(KERNEL_SOURCE)/usr/src/uts/common -nostdinc -c -DUTS_RELEASE="5.11" -DUTS_VERSION="joyent.147" -DUTS_PLATFORM="i86pc" -mno-red-zone INCLUDEDIR= -I $(KERNEL_SOURCE)/usr/src/uts/intel -I $(KERNEL_SOURCE)/usr/src/uts/i86pc -I $(KERNEL_SOURCE)/usr/src/uts/common CSTYLE=$(KERNEL_SOURCE)/usr/src/tools/scripts/cstyle @@ -47,7 +47,7 @@ #include "apicdef.h" #include "kvm_iodev.h" #include "kvm.h" -#include "irq.h" +#include "kvm_irq.h" #include "tss.h" #include "kvm_ioapic.h" #include "kvm_coalesced_mmio.h" diff --git a/kvm_cache_regs.c b/kvm_cache_regs.c index 599afd2..cc34963 100644 --- a/kvm_cache_regs.c +++ b/kvm_cache_regs.c @@ -15,7 +15,7 @@ #include "apicdef.h" #include "kvm_ioapic.h" #include "kvm_lapic.h" -#include "irq.h" +#include "kvm_irq.h" #include "kvm_cache_regs.h" diff --git a/kvm_coalesced_mmio.c b/kvm_coalesced_mmio.c index 3635c49..319d980 100644 --- a/kvm_coalesced_mmio.c +++ b/kvm_coalesced_mmio.c @@ -20,7 +20,7 @@ #include "kvm.h" #include "apicdef.h" #include "kvm_ioapic.h" -#include "irq.h" +#include "kvm_irq.h" #include "kvm_iodev.h" #include "kvm_coalesced_mmio.h" diff --git a/kvm_i8254.c b/kvm_i8254.c index 91ce910..4b0c2bc 100644 --- a/kvm_i8254.c +++ b/kvm_i8254.c @@ -42,7 +42,7 @@ #include "kvm_iodev.h" #include "kvm.h" #include "kvm_i8254.h" -#include "irq.h" +#include "kvm_irq.h" extern int kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu); diff --git a/kvm_i8259.c b/kvm_i8259.c index e6d5e55..04e1fe7 100644 --- a/kvm_i8259.c +++ b/kvm_i8259.c @@ -41,7 +41,7 @@ #include "apicdef.h" #include "kvm_ioapic.h" #include "kvm_lapic.h" -#include "irq.h" +#include "kvm_irq.h" static void pic_clear_isr(struct kvm_kpic_state *s, int irq) diff --git a/kvm_ioapic.c b/kvm_ioapic.c index 285cf72..4628f56 100644 --- a/kvm_ioapic.c +++ b/kvm_ioapic.c @@ -40,7 +40,7 @@ #include "kvm.h" #include "apicdef.h" #include "kvm_ioapic.h" -#include "irq.h" +#include "kvm_irq.h" static int ioapic_deliver(struct kvm_ioapic *, int); @@ -21,21 +21,29 @@ * Copyright 2011 Joyent, Inc. All rights reserved. */ -/* - * XXX These header includes are really broken - */ -#include "msr.h" -#include "irqflags.h" #include "kvm_host.h" -#include "kvm_x86host.h" -#include "kvm_iodev.h" -#include "kvm.h" -#include "irq.h" -#include "kvm_lapic.h" -#include "kvm_ioapic.h" - -/* XXX This should never exist */ -extern int irqchip_in_kernel(struct kvm *); +#include "kvm_i8254.h" +#include "kvm_irq.h" + +struct kvm_pic * +pic_irqchip(struct kvm *kvm) +{ + return (kvm->arch.vpic); +} + +int +irqchip_in_kernel(struct kvm *kvm) +{ + int ret; + + ret = (pic_irqchip(kvm) != NULL); +#ifdef XXX + smp_rmb(); +#else + XXX_KVM_SYNC_PROBE; +#endif + return (ret); +} /* * check if there are pending timer events @@ -1,5 +1,5 @@ /* - * irq.h: in kernel interrupt controller related definitions + * kvm_irq.h: in kernel interrupt controller related definitions * Copyright (c) 2007, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it @@ -22,16 +22,12 @@ #ifndef __IRQ_H #define __IRQ_H -#ifdef XXX -#include <linux/mm_types.h> -#include <linux/hrtimer.h> -#include <linux/kvm_host.h> -#include <linux/spinlock.h> +#include <sys/mutex.h> +#include "kvm_host.h" #include "kvm_iodev.h" #include "kvm_ioapic.h" #include "kvm_lapic.h" -#endif /*XXX*/ #define PIC_NUM_PINS 16 #define SELECT_PIC(irq) \ @@ -82,11 +78,8 @@ int kvm_pic_read_irq(struct kvm *kvm); void kvm_pic_update_irq(struct kvm_pic *s); void kvm_pic_clear_isr_ack(struct kvm *kvm); -static struct kvm_pic *pic_irqchip(struct kvm *kvm) -{ - return kvm->arch.vpic; -} - +struct kvm_pic *pic_irqchip(struct kvm *kvm); +int irqchip_in_kernel(struct kvm *kvm); void kvm_pic_reset(struct kvm_kpic_state *s); void kvm_inject_pit_timer_irqs(struct kvm_vcpu *vcpu); diff --git a/kvm_irq_comm.c b/kvm_irq_comm.c index f4df4e1..aa2ef74 100644 --- a/kvm_irq_comm.c +++ b/kvm_irq_comm.c @@ -35,7 +35,7 @@ #include "apicdef.h" #include "kvm_lapic.h" #include "kvm_ioapic.h" -#include "irq.h" +#include "kvm_irq.h" extern long find_first_zero_bit(const unsigned long *, unsigned long); extern int kvm_pic_set_irq(void *, int, int); diff --git a/kvm_lapic.c b/kvm_lapic.c index 86710ed..986c59d 100644 --- a/kvm_lapic.c +++ b/kvm_lapic.c @@ -35,7 +35,7 @@ #include "apicdef.h" #include "kvm_ioapic.h" #include "kvm_lapic.h" -#include "irq.h" +#include "kvm_irq.h" int __apic_accept_irq(struct kvm_lapic *, int, int, int, int); /* XXX */ @@ -8,7 +8,7 @@ #include "kvm_x86host.h" #include "kvm_iodev.h" #include "kvm.h" -#include "irq.h" +#include "kvm_irq.h" #include "kvm_mmu.h" /* @@ -35,7 +35,7 @@ #include "apicdef.h" #include "kvm_ioapic.h" #include "kvm_lapic.h" -#include "irq.h" +#include "kvm_irq.h" #include "kvm_mmu.h" #include "vmx.h" @@ -40,7 +40,7 @@ #include "percpu-defs.h" #include "kvm_coalesced_mmio.h" #include "kvm.h" -#include "irq.h" +#include "kvm_irq.h" #include "kvm_i8254.h" #include "kvm_lapic.h" #include "kvm_cache_regs.h" @@ -440,20 +440,6 @@ kvm_dev_ioctl_check_extension(long ext, int *rval_p) return (r); } -int -irqchip_in_kernel(struct kvm *kvm) -{ - int ret; - - ret = (pic_irqchip(kvm) != NULL); -#ifdef XXX - smp_rmb(); -#else - XXX_KVM_SYNC_PROBE; -#endif - return (ret); -} - extern page_t *alloc_page(size_t size, int flag); extern caddr_t page_address(page_t *page); |