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>
---
 Makefile              |  2 +-
 bsd/sys/xen/evtchn.cc |  1 -
 bsd/sys/xen/evtchn.h  |  2 ++
 core/xen_intr.cc      | 20 +++-----------------
 4 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/Makefile b/Makefile
index 60404ef..6846c5e 100644
--- 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
index 825695c..a33ecf6 100644
--- 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
index cc231a7..0891a00 100644
--- 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
index 6ea52e5..7a9dad2 100644
--- 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);
-- 
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