aboutsummaryrefslogtreecommitdiffstats
path: root/include/xen
diff options
context:
space:
mode:
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>2011-10-27 17:58:47 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-11-21 17:14:48 -0500
commit420eb554d5ee6daad743d8190383219f757dd66c (patch)
tree0c8b69dbc2de5aea96be93a24a8b39dbb9256b88 /include/xen
parent0cc678f850f2cba0cedbd133fcbbf175554cd6c6 (diff)
xen/event: Add reference counting to event channels
Event channels exposed to userspace by the evtchn module may be used by other modules in an asynchronous manner, which requires that reference counting be used to prevent the event channel from being closed before the signals are delivered. The reference count on new event channels defaults to -1 which indicates the event channel is not referenced outside the kernel; evtchn_get fails if called on such an event channel. The event channels made visible to userspace by evtchn have a normal reference count. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'include/xen')
-rw-r--r--include/xen/events.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/xen/events.h b/include/xen/events.h
index d287997d3eab..0f773708e02c 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -37,6 +37,13 @@ int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain,
37 */ 37 */
38void unbind_from_irqhandler(unsigned int irq, void *dev_id); 38void unbind_from_irqhandler(unsigned int irq, void *dev_id);
39 39
40/*
41 * Allow extra references to event channels exposed to userspace by evtchn
42 */
43int evtchn_make_refcounted(unsigned int evtchn);
44int evtchn_get(unsigned int evtchn);
45void evtchn_put(unsigned int evtchn);
46
40void xen_send_IPI_one(unsigned int cpu, enum ipi_vector vector); 47void xen_send_IPI_one(unsigned int cpu, enum ipi_vector vector);
41int resend_irq_on_evtchn(unsigned int irq); 48int resend_irq_on_evtchn(unsigned int irq);
42void rebind_evtchn_irq(int evtchn, int irq); 49void rebind_evtchn_irq(int evtchn, int irq);