aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_evtchn.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-10-22 15:14:51 +0100
committerIan Campbell <ian.campbell@citrix.com>2010-10-22 15:14:51 +0100
commitf90254ea2e5f0c96085a080db814abf05c417f9c (patch)
tree26781cf11626ba1032d6cb97a2cc1334e2467000 /tools/libxc/xc_evtchn.c
parentf0073092d2cf46b47acda6c1ece96777397263fd (diff)
downloadxen-f90254ea2e5f0c96085a080db814abf05c417f9c.tar.gz
xen-f90254ea2e5f0c96085a080db814abf05c417f9c.tar.bz2
xen-f90254ea2e5f0c96085a080db814abf05c417f9c.zip
libxc: convert evtchn interfaces over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxc/xc_evtchn.c')
-rw-r--r--tools/libxc/xc_evtchn.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c
index da35e2ac7f..528b59305b 100644
--- a/tools/libxc/xc_evtchn.c
+++ b/tools/libxc/xc_evtchn.c
@@ -22,32 +22,31 @@
#include "xc_private.h"
-
static int do_evtchn_op(xc_interface *xch, int cmd, void *arg,
size_t arg_size, int silently_fail)
{
int ret = -1;
DECLARE_HYPERCALL;
+ DECLARE_HYPERCALL_BOUNCE(arg, arg_size, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
- hypercall.op = __HYPERVISOR_event_channel_op;
- hypercall.arg[0] = cmd;
- hypercall.arg[1] = (unsigned long)arg;
-
- if ( lock_pages(xch, arg, arg_size) != 0 )
+ if ( xc_hypercall_bounce_pre(xch, arg) )
{
- PERROR("do_evtchn_op: arg lock failed");
+ PERROR("do_evtchn_op: bouncing arg failed");
goto out;
}
+ hypercall.op = __HYPERVISOR_event_channel_op;
+ hypercall.arg[0] = cmd;
+ hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
if ((ret = do_xen_hypercall(xch, &hypercall)) < 0 && !silently_fail)
ERROR("do_evtchn_op: HYPERVISOR_event_channel_op failed: %d", ret);
- unlock_pages(xch, arg, arg_size);
+ xc_hypercall_bounce_post(xch, arg);
out:
return ret;
}
-
evtchn_port_or_error_t
xc_evtchn_alloc_unbound(xc_interface *xch,
uint32_t dom,