aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/event_channel.c
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@citrix.com>2013-10-14 10:22:07 +0200
committerJan Beulich <jbeulich@suse.com>2013-10-14 10:22:07 +0200
commit88910061ec615b2d05e721a82c37139e05df0712 (patch)
tree737705119f80bc450ac2272eca1b8c247e230445 /xen/common/event_channel.c
parentedc8872aeb4a6e6a50775d6088aab97324ee3e15 (diff)
downloadxen-88910061ec615b2d05e721a82c37139e05df0712.tar.gz
xen-88910061ec615b2d05e721a82c37139e05df0712.tar.bz2
xen-88910061ec615b2d05e721a82c37139e05df0712.zip
evtchn: add FIFO-based event channel hypercalls and port ops
Add the implementation for the FIFO-based event channel ABI. The new hypercall sub-ops (EVTCHNOP_init_control, EVTCHNOP_expand_array) and the required evtchn_ops (set_pending, unmask, etc.). Signed-off-by: David Vrabel <david.vrabel@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/event_channel.c')
-rw-r--r--xen/common/event_channel.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 340bf32583..0c0bbe494f 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -26,6 +26,7 @@
#include <xen/compat.h>
#include <xen/guest_access.h>
#include <xen/keyhandler.h>
+#include <xen/event_fifo.h>
#include <asm/current.h>
#include <public/xen.h>
@@ -1085,6 +1086,24 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
break;
}
+ case EVTCHNOP_init_control: {
+ struct evtchn_init_control init_control;
+ if ( copy_from_guest(&init_control, arg, 1) != 0 )
+ return -EFAULT;
+ rc = evtchn_fifo_init_control(&init_control);
+ if ( !rc && __copy_to_guest(arg, &init_control, 1) )
+ rc = -EFAULT;
+ break;
+ }
+
+ case EVTCHNOP_expand_array: {
+ struct evtchn_expand_array expand_array;
+ if ( copy_from_guest(&expand_array, arg, 1) != 0 )
+ return -EFAULT;
+ rc = evtchn_fifo_expand_array(&expand_array);
+ break;
+ }
+
case EVTCHNOP_set_priority: {
struct evtchn_set_priority set_priority;
if ( copy_from_guest(&set_priority, arg, 1) != 0 )
@@ -1269,6 +1288,8 @@ void evtchn_destroy(struct domain *d)
spin_unlock(&d->event_lock);
clear_global_virq_handlers(d);
+
+ evtchn_fifo_destroy(d);
}