xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: xen-devel@lists.xensource.com
Cc: Jan Beulich <JBeulich@novell.com>,
	linux-kernel@vger.kernel.org,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [PATCH 5/9] xen: implement bind_interdomain_evtchn_to_irqhandler for backend drivers
Date: Mon, 13 Dec 2010 13:01:39 -0500	[thread overview]
Message-ID: <1292263303-31680-6-git-send-email-konrad.wilk@oracle.com> (raw)
In-Reply-To: <1292263303-31680-1-git-send-email-konrad.wilk@oracle.com>

From: Ian Campbell <ian.campbell@citrix.com>

Impact: new Xen-internal API

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/xen/events.c |   38 ++++++++++++++++++++++++++++++++++++++
 include/xen/events.h |    6 ++++++
 2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 690dfad..95eea13 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -849,6 +849,21 @@ static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu)
 	return irq;
 }
 
+static int bind_interdomain_evtchn_to_irq(unsigned int remote_domain,
+                                          unsigned int remote_port)
+{
+        struct evtchn_bind_interdomain bind_interdomain;
+        int err;
+
+        bind_interdomain.remote_dom  = remote_domain;
+        bind_interdomain.remote_port = remote_port;
+
+        err = HYPERVISOR_event_channel_op(EVTCHNOP_bind_interdomain,
+                                          &bind_interdomain);
+
+        return err ? : bind_evtchn_to_irq(bind_interdomain.local_port);
+}
+
 
 int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
 {
@@ -944,6 +959,29 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
 }
 EXPORT_SYMBOL_GPL(bind_evtchn_to_irqhandler);
 
+int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain,
+					  unsigned int remote_port,
+					  irq_handler_t handler,
+					  unsigned long irqflags,
+					  const char *devname,
+					  void *dev_id)
+{
+        int irq, retval;
+
+        irq = bind_interdomain_evtchn_to_irq(remote_domain, remote_port);
+        if (irq < 0)
+                return irq;
+
+        retval = request_irq(irq, handler, irqflags, devname, dev_id);
+        if (retval != 0) {
+                unbind_from_irq(irq);
+                return retval;
+        }
+
+        return irq;
+}
+EXPORT_SYMBOL_GPL(bind_interdomain_evtchn_to_irqhandler);
+
 int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
 			    irq_handler_t handler,
 			    unsigned long irqflags, const char *devname, void *dev_id)
diff --git a/include/xen/events.h b/include/xen/events.h
index 553c664..2fe1644 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -23,6 +23,12 @@ int bind_ipi_to_irqhandler(enum ipi_vector ipi,
 			   unsigned long irqflags,
 			   const char *devname,
 			   void *dev_id);
+int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain,
+					  unsigned int remote_port,
+					  irq_handler_t handler,
+					  unsigned long irqflags,
+					  const char *devname,
+					  void *dev_id);
 
 /*
  * Common unbind function for all event sources. Takes IRQ to unbind from.
-- 
1.7.1

  parent reply	other threads:[~2010-12-13 18:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-13 18:01 [PATCH v2] Xen PCI backend driver Konrad Rzeszutek Wilk
2010-12-13 18:01 ` [PATCH 1/9] xen: export xen_gsi_from_irq, it is required by modular pciback Konrad Rzeszutek Wilk
2010-12-13 18:01 ` [PATCH 2/9] xen/pci: Add xen_[find|register|unregister]_device_domain_owner functions Konrad Rzeszutek Wilk
2010-12-13 19:28   ` Jeremy Fitzhardinge
2010-12-13 18:01 ` [PATCH 3/9] xen: Check if the PCI device is owned by a domain different than DOMID_SELF Konrad Rzeszutek Wilk
2010-12-13 18:01 ` [PATCH 4/9] xen: Add support to check if IRQ line is shared with other domains Konrad Rzeszutek Wilk
2010-12-13 19:34   ` Jeremy Fitzhardinge
2010-12-13 18:01 ` Konrad Rzeszutek Wilk [this message]
2010-12-13 18:01 ` [PATCH 6/9] pci/xen: Make xen_[find|register|unregister]_domain_owner be _GPL Konrad Rzeszutek Wilk
2010-12-13 19:18   ` Jeremy Fitzhardinge
2010-12-13 18:01 ` [PATCH 7/9] xen-pciback: Backend driver for Xen pci-front Konrad Rzeszutek Wilk
2010-12-13 18:01 ` [PATCH 8/9] xen/pciback: Fix checkpatch warnings and errors Konrad Rzeszutek Wilk
2010-12-13 18:01 ` [PATCH 9/9] xen/xen-pciback: Swap over to DEFINE_PCI_DEVICE_TABLE Konrad Rzeszutek Wilk
2010-12-14 10:08   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1292263303-31680-6-git-send-email-konrad.wilk@oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@novell.com \
    --cc=ian.campbell@citrix.com \
    --cc=jeremy.fitzhardinge@citrix.com \
    --cc=jeremy@goop.org \
    --cc=konrad@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).