Remove evtchn_do_upcall() and related code, which isn't used anywhere
else and probably never will be.

xen_irq::do_irq() already handles events in OSv-specific way, while
bsd code just contributes duplication and causes some confusion.

Signed-off-by: Sergiy Kibrik <sergiy.kib...@globallogic.com>
---
 bsd/aarch64/machine/intr_machdep.h |  1 -
 bsd/sys/xen/evtchn.cc              | 54 --------------------------------------
 bsd/sys/xen/evtchn.h               |  7 -----
 bsd/x64/machine/intr_machdep.h     |  1 -
 bsd/x64/machine/xen/xen-os.h       |  8 ------
 core/xen_intr.cc                   |  8 ------
 6 files changed, 79 deletions(-)

diff --git a/bsd/aarch64/machine/intr_machdep.h 
b/bsd/aarch64/machine/intr_machdep.h
index c778cfe..b0dcba6 100644
--- a/bsd/aarch64/machine/intr_machdep.h
+++ b/bsd/aarch64/machine/intr_machdep.h
@@ -152,7 +152,6 @@ int intr_bind(u_int vector, u_char cpu);
 int    intr_config_intr(int vector, enum intr_trigger trig,
     enum intr_polarity pol);
 int    intr_describe(u_int vector, void *ih, const char *descr);
-void   intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame);
 u_int  intr_next_cpu(void);
 struct intsrc *intr_lookup_source(int vector);
 int    intr_register_pic(struct pic *pic);
diff --git a/bsd/sys/xen/evtchn.cc b/bsd/sys/xen/evtchn.cc
index 57eccff..825695c 100644
--- a/bsd/sys/xen/evtchn.cc
+++ b/bsd/sys/xen/evtchn.cc
@@ -49,9 +49,6 @@ __FBSDID("$FreeBSD$");
 #define mtx_lock_spin(x) do {  mtx_lock(x); } while (0)
 #define mtx_unlock_spin(x) do { mtx_unlock(x); } while (0)
 
-// We don't expose an evtchn device.
-#define evtchn_device_upcall(x) do {} while (0)
-
 /*
  * irq_mapping_update_lock: in order to allow an interrupt to occur in a 
critical
  *     section, to set pcpu->ipending (etc...) properly, we
@@ -157,12 +154,6 @@ static bool irq_is_legacy = 0;
 
 static uint8_t cpu_evtchn[NR_EVENT_CHANNELS];
 static unsigned long 
cpu_evtchn_mask[MAX_VIRT_CPUS][NR_EVENT_CHANNELS/LONG_BIT];
-
-#define active_evtchns(cpu,sh,idx)             \
-       ((sh)->evtchn_pending[idx] &            \
-        cpu_evtchn_mask[cpu][idx] &            \
-        ~(sh)->evtchn_mask[idx])
-
 static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
 {
        clear_bit(chn, (unsigned long *)cpu_evtchn_mask[cpu_evtchn[chn]]);
@@ -181,9 +172,6 @@ static void init_evtchn_cpu_bindings(void)
 
 #else
 
-#define active_evtchns(cpu,sh,idx)             \
-       ((sh)->evtchn_pending[idx] &            \
-        ~(sh)->evtchn_mask[idx])
 #define bind_evtchn_to_cpu(chn,cpu)    ((void)0)
 #define init_evtchn_cpu_bindings()     ((void)0)
 #define cpu_from_evtchn(evtchn)                (0)
@@ -205,48 +193,6 @@ void force_evtchn_callback(void)
        (void)HYPERVISOR_xen_version(0, NULL);
 }
 
-void 
-evtchn_do_upcall(struct trapframe *frame) 
-{
-       unsigned int   l1, l2;
-       unsigned int   l1i, l2i, port;
-       int            irq, cpu;
-       shared_info_t *s;
-       vcpu_info_t   *vcpu_info;
-       
-       cpu = PCPU_GET(cpuid);
-       s = HYPERVISOR_shared_info;
-       vcpu_info = &s->vcpu_info[cpu];
-
-       vcpu_info->evtchn_upcall_pending = 0;
-
-       /* NB. No need for a barrier here -- XCHG is a barrier on x86. */
-       l1 = xen_xchg(&vcpu_info->evtchn_pending_sel, 0);
-
-       while (l1 != 0) {
-               l1i = __ffs(l1);
-               l1 &= ~(1 << l1i);
-               
-               while ((l2 = active_evtchns(cpu, s, l1i)) != 0) {
-                       l2i = __ffs(l2);
-
-                       port = (l1i * LONG_BIT) + l2i;
-                       if ((irq = evtchn_to_irq[port]) != -1) {
-                               struct intsrc *isrc = intr_lookup_source(irq);
-                               /* 
-                                * ack 
-                                */
-                               mask_evtchn(port);
-                               clear_evtchn(port); 
-
-                               intr_execute_handlers(isrc, frame);
-                       } else {
-                               evtchn_device_upcall(port);
-                       }
-               }
-       }
-}
-
 /*
  * Send an IPI from the current CPU to the destination CPU.
  */
diff --git a/bsd/sys/xen/evtchn.h b/bsd/sys/xen/evtchn.h
index 74767d4..cc231a7 100644
--- a/bsd/sys/xen/evtchn.h
+++ b/bsd/sys/xen/evtchn.h
@@ -26,13 +26,6 @@
  */
 void notify_remote_via_irq(int irq);
 
-
-/* Entry point for notifications into Linux subsystems. */
-void evtchn_do_upcall(struct trapframe *frame);
-
-/* Entry point for notifications into the userland character device. */
-void evtchn_device_upcall(int port);
-
 void mask_evtchn(int port);
 
 void unmask_evtchn(int port);
diff --git a/bsd/x64/machine/intr_machdep.h b/bsd/x64/machine/intr_machdep.h
index c778cfe..b0dcba6 100644
--- a/bsd/x64/machine/intr_machdep.h
+++ b/bsd/x64/machine/intr_machdep.h
@@ -152,7 +152,6 @@ int intr_bind(u_int vector, u_char cpu);
 int    intr_config_intr(int vector, enum intr_trigger trig,
     enum intr_polarity pol);
 int    intr_describe(u_int vector, void *ih, const char *descr);
-void   intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame);
 u_int  intr_next_cpu(void);
 struct intsrc *intr_lookup_source(int vector);
 int    intr_register_pic(struct pic *pic);
diff --git a/bsd/x64/machine/xen/xen-os.h b/bsd/x64/machine/xen/xen-os.h
index ba92f6b..e6469b7 100644
--- a/bsd/x64/machine/xen/xen-os.h
+++ b/bsd/x64/machine/xen/xen-os.h
@@ -163,14 +163,6 @@ do {                                                       
             \
  */
 typedef struct { volatile int counter; } atomic_t;
 
-static inline unsigned int __ffs(unsigned int word)
-{
-        __asm__("bsfl %1,%0"
-                :"=r" (word)
-                :"rm" (word));
-        return word;
-}
-
 #define xen_xchg(ptr,v) \
         ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
 struct __xchg_dummy { unsigned long a[100]; };
diff --git a/core/xen_intr.cc b/core/xen_intr.cc
index 0c31d2c..45a1869 100644
--- a/core/xen_intr.cc
+++ b/core/xen_intr.cc
@@ -169,14 +169,6 @@ intr_register_source(struct intsrc *isrc)
 {
     return 0;
 }
-
-void
-intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame)
-{
-    // Make sure we are never called by the BSD code
-    abort();
-}
-
 struct intsrc *
 intr_lookup_source(int vector)
 {
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to