From: Sergiy Kibrik' via OSv Development <osv-dev@googlegroups.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

osv: xen_intr: use evtchn.h

Replace local declaration of unmask_evtchn() and evtchn_from_irq()
with inclusion of evtchn.h where they're declared.

Additionally declare evtchn_from_irq() in header,
as it's used in Xen core interrupt handler.

Include evtchn driver into common build, so that aarch64 code can link.

Signed-off-by: Sergiy Kibrik <sergiy.kib...@globallogic.com>
Message-Id: <1487597529-28580-7-git-send-email-sergiy.kib...@globallogic.com>

---
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -595,11 +595,11 @@ bsd += bsd/sys/netinet/arpcache.o
 bsd += bsd/sys/xdr/xdr.o
 bsd += bsd/sys/xdr/xdr_array.o
 bsd += bsd/sys/xdr/xdr_mem.o
+bsd += bsd/sys/xen/evtchn.o

 ifeq ($(arch),x64)
 $(out)/bsd/%.o: COMMON += -DXEN -DXENHVM
 bsd += bsd/sys/xen/gnttab.o
-bsd += bsd/sys/xen/evtchn.o
 bsd += bsd/sys/xen/xenstore/xenstore.o
 bsd += bsd/sys/xen/xenbus/xenbus.o
 bsd += bsd/sys/xen/xenbus/xenbusb.o
diff --git a/bsd/sys/xen/evtchn.cc b/bsd/sys/xen/evtchn.cc
--- a/bsd/sys/xen/evtchn.cc
+++ b/bsd/sys/xen/evtchn.cc
@@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
 #include <machine/intr_machdep.h>

 #include <machine/xen/xen-os.h>
-#include <machine/xen/xenvar.h>
 #include <xen/xen_intr.h>
 #include <machine/xen/synch_bitops.h>
 #include <xen/evtchn.h>
diff --git a/bsd/sys/xen/evtchn.h b/bsd/sys/xen/evtchn.h
--- a/bsd/sys/xen/evtchn.h
+++ b/bsd/sys/xen/evtchn.h
@@ -30,6 +30,8 @@ void mask_evtchn(int port);

 void unmask_evtchn(int port);

+int evtchn_from_irq(int irq);
+
 #ifdef SMP
 void rebind_evtchn_to_cpu(int port, unsigned int cpu);
 #else
diff --git a/core/xen_intr.cc b/core/xen_intr.cc
--- a/core/xen_intr.cc
+++ b/core/xen_intr.cc
@@ -8,7 +8,10 @@
 #include <osv/xen.hh>
 #include <osv/xen_intr.hh>
 #include <bsd/porting/bus.h>
+#include <bsd/porting/netport.h>
 #include <machine/intr_machdep.h>
+#include <machine/xen/xen-os.h>
+#include <xen/evtchn.h>
 #include <osv/bitops.h>
 #include <osv/debug.hh>

@@ -21,23 +24,6 @@ TRACEPOINT(trace_xen_irq_ret, "");
 TRACEPOINT(trace_xen_irq_exec, "");
 TRACEPOINT(trace_xen_irq_exec_ret, "");

-/*FIXME: use xen/evtchn.h when aarch64 supprted */
-#if defined(__x86_64__)
-void unmask_evtchn(int vector);
-int evtchn_from_irq(int irq);
-#else
-void unmask_evtchn(int port)
-{
-}
-
-int evtchn_from_irq(int irq)
-{
-    abort("Not implemented yet");
-    return 0; /* keep compiler happy */
-}
-
-#endif
-
 namespace xen {

 PERCPU(sched::thread *, xen_irq::_thread);

--
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