From 58d82ce99a015ac0275f1b8c57f9269403c634d4 Mon Sep 17 00:00:00 2001
From: Julien Grall <julien.grall@linaro.org>
Date: Tue, 14 Jan 2014 01:41:18 +0000
Subject: [PATCH 03/48] xen: Define xen_intr_handle_upcall in common headers

The function xen_intr_handle_upcall is used on every architecture supported
by Xen. It's pointless to define on every platform...
---
 sys/dev/xen/xenpci/xenpci.c | 3 +--
 sys/x86/include/apicvar.h   | 1 -
 sys/xen/xen_intr.h          | 4 ++++
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/sys/dev/xen/xenpci/xenpci.c b/sys/dev/xen/xenpci/xenpci.c
index 3fdd78c..3a596b4 100644
--- a/sys/dev/xen/xenpci/xenpci.c
+++ b/sys/dev/xen/xenpci/xenpci.c
@@ -43,14 +43,13 @@ __FBSDID("$FreeBSD$");
 #include <xen/features.h>
 #include <xen/hypervisor.h>
 #include <xen/hvm.h>
+#include <xen/xen_intr.h>
 
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 
 #include <dev/xen/xenpci/xenpcivar.h>
 
-extern void xen_intr_handle_upcall(struct trapframe *trap_frame);
-
 /*
  * This is used to find our platform device instance.
  */
diff --git a/sys/x86/include/apicvar.h b/sys/x86/include/apicvar.h
index 35603e8..6c1207c 100644
--- a/sys/x86/include/apicvar.h
+++ b/sys/x86/include/apicvar.h
@@ -415,7 +415,6 @@ void	lapic_handle_cmc(void);
 void	lapic_handle_error(void);
 void	lapic_handle_intr(int vector, struct trapframe *frame);
 void	lapic_handle_timer(struct trapframe *frame);
-void	xen_intr_handle_upcall(struct trapframe *frame);
 
 #endif /* !LOCORE */
 #endif /* _X86_APICVAR_H_ */
diff --git a/sys/xen/xen_intr.h b/sys/xen/xen_intr.h
index d2d6470..2420ba1 100644
--- a/sys/xen/xen_intr.h
+++ b/sys/xen/xen_intr.h
@@ -39,12 +39,16 @@ DEFINE_XEN_GUEST_HANDLE(evtchn_port_t);
 #define __XEN_EVTCHN_PORT_DEFINED__ 1
 #endif
 
+#include <xen/interface/event_channel.h>
+
 /** Registered Xen interrupt callback handle. */
 typedef void * xen_intr_handle_t;
 
 /** If non-zero, the hypervisor has been configured to use a direct vector */
 extern int xen_vector_callback_enabled;
 
+void xen_intr_handle_upcall(struct trapframe *trap_frame);
+
 /**
  * Associate an already allocated local event channel port an interrupt
  * handler.
-- 
2.1.0

