aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/xen/events.c38
-rw-r--r--include/xen/events.h6
2 files changed, 44 insertions, 0 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 74681478100a..a41601675633 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -864,6 +864,21 @@ static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu)
864 return irq; 864 return irq;
865} 865}
866 866
867static int bind_interdomain_evtchn_to_irq(unsigned int remote_domain,
868 unsigned int remote_port)
869{
870 struct evtchn_bind_interdomain bind_interdomain;
871 int err;
872
873 bind_interdomain.remote_dom = remote_domain;
874 bind_interdomain.remote_port = remote_port;
875
876 err = HYPERVISOR_event_channel_op(EVTCHNOP_bind_interdomain,
877 &bind_interdomain);
878
879 return err ? : bind_evtchn_to_irq(bind_interdomain.local_port);
880}
881
867 882
868int bind_virq_to_irq(unsigned int virq, unsigned int cpu) 883int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
869{ 884{
@@ -959,6 +974,29 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
959} 974}
960EXPORT_SYMBOL_GPL(bind_evtchn_to_irqhandler); 975EXPORT_SYMBOL_GPL(bind_evtchn_to_irqhandler);
961 976
977int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain,
978 unsigned int remote_port,
979 irq_handler_t handler,
980 unsigned long irqflags,
981 const char *devname,
982 void *dev_id)
983{
984 int irq, retval;
985
986 irq = bind_interdomain_evtchn_to_irq(remote_domain, remote_port);
987 if (irq < 0)
988 return irq;
989
990 retval = request_irq(irq, handler, irqflags, devname, dev_id);
991 if (retval != 0) {
992 unbind_from_irq(irq);
993 return retval;
994 }
995
996 return irq;
997}
998EXPORT_SYMBOL_GPL(bind_interdomain_evtchn_to_irqhandler);
999
962int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, 1000int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
963 irq_handler_t handler, 1001 irq_handler_t handler,
964 unsigned long irqflags, const char *devname, void *dev_id) 1002 unsigned long irqflags, const char *devname, void *dev_id)
diff --git a/include/xen/events.h b/include/xen/events.h
index 00f53ddcc062..bd03b1e4a2f4 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -23,6 +23,12 @@ int bind_ipi_to_irqhandler(enum ipi_vector ipi,
23 unsigned long irqflags, 23 unsigned long irqflags,
24 const char *devname, 24 const char *devname,
25 void *dev_id); 25 void *dev_id);
26int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain,
27 unsigned int remote_port,
28 irq_handler_t handler,
29 unsigned long irqflags,
30 const char *devname,
31 void *dev_id);
26 32
27/* 33/*
28 * Common unbind function for all event sources. Takes IRQ to unbind from. 34 * Common unbind function for all event sources. Takes IRQ to unbind from.