diff options
author | kmacy <kmacy@FreeBSD.org> | 2008-09-26 05:54:24 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2008-09-26 05:54:24 +0000 |
commit | ee87f9c03f3363226009b04be8739a0c94aa18ba (patch) | |
tree | 87fb843f20e48fd58b6c1af6bfc4a9cd7b17d6b4 | |
parent | 65146c6fd4604a8e65ab81176157e6ccfa9b6f34 (diff) | |
download | FreeBSD-src-ee87f9c03f3363226009b04be8739a0c94aa18ba.zip FreeBSD-src-ee87f9c03f3363226009b04be8739a0c94aa18ba.tar.gz |
move ipi_pcpu to evtchn.c
-rw-r--r-- | sys/i386/include/xen/evtchn.h | 1 | ||||
-rw-r--r-- | sys/i386/xen/mp_machdep.c | 12 | ||||
-rw-r--r-- | sys/xen/evtchn/evtchn.c | 22 |
3 files changed, 17 insertions, 18 deletions
diff --git a/sys/i386/include/xen/evtchn.h b/sys/i386/include/xen/evtchn.h index 1124105..92ee578 100644 --- a/sys/i386/include/xen/evtchn.h +++ b/sys/i386/include/xen/evtchn.h @@ -59,6 +59,7 @@ notify_remote_via_evtchn(int port) */ int irq_to_evtchn_port(int irq); +void ipi_pcpu(unsigned int cpu, int vector); /* * CHARACTER-DEVICE DEFINITIONS diff --git a/sys/i386/xen/mp_machdep.c b/sys/i386/xen/mp_machdep.c index 651d14d..c1af917 100644 --- a/sys/i386/xen/mp_machdep.c +++ b/sys/i386/xen/mp_machdep.c @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); #include <machine/xen/xen-os.h> +#include <machine/xen/evtchn.h> #include <machine/xen/hypervisor.h> #include <xen/interface/vcpu.h> @@ -906,17 +907,6 @@ smp_masked_invlpg_range(u_int mask, vm_offset_t addr1, vm_offset_t addr2) } } -static __inline void -ipi_pcpu(unsigned int cpu, int vector) -{ -#ifdef notyet - int irq = per_cpu(ipi_to_irq, cpu)[vector]; - - notify_remote_via_irq(irq); -#endif -} - - void ipi_bitmap_handler(struct trapframe frame) { diff --git a/sys/xen/evtchn/evtchn.c b/sys/xen/evtchn/evtchn.c index de3cf0c..53b41ac 100644 --- a/sys/xen/evtchn/evtchn.c +++ b/sys/xen/evtchn/evtchn.c @@ -112,14 +112,14 @@ enum { #define index_from_irq(irq) ((uint8_t)(irq_info[irq] >> 16)) #define type_from_irq(irq) ((uint8_t)(irq_info[irq] >> 24)) -/* IRQ <-> VIRQ mapping. */ -DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]); - -/* IRQ <-> IPI mapping. */ -#ifndef NR_IPIS +/* IRQ <-> VIRQ mapping. */ +DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]) = {[0 ... NR_VIRQS-1] = -1}; + +/* IRQ <-> IPI mapping. */ +#ifndef NR_IPIS #define NR_IPIS 1 -#endif -DEFINE_PER_CPU(int, ipi_to_irq[NR_IPIS]); +#endif +DEFINE_PER_CPU(int, ipi_to_irq[NR_IPIS]) = {[0 ... NR_IPIS-1] = -1}; /* Bitmap indicating which PIRQs require Xen to be notified on unmask. */ static unsigned long pirq_needs_unmask_notify[NR_PIRQS/sizeof(unsigned long)]; @@ -219,6 +219,14 @@ evtchn_do_upcall(struct trapframe *frame) } } +void +ipi_pcpu(unsigned int cpu, int vector) +{ + int irq = per_cpu(ipi_to_irq, cpu)[vector]; + + notify_remote_via_irq(irq); +} + static int find_unbound_irq(void) { |