aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_private.h
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
commit4513025a87902aa4469b15e8097beb7590da7b78 (patch)
tree6639b374163076d128b6a5e54a124404b45e8b04 /tools/libxc/xc_private.h
parent231c3160913a957cb9aeb693a7966ac3f8ecc780 (diff)
downloadxen-4513025a87902aa4469b15e8097beb7590da7b78.tar.gz
xen-4513025a87902aa4469b15e8097beb7590da7b78.tar.bz2
xen-4513025a87902aa4469b15e8097beb7590da7b78.zip
libxc: convert sysctl 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_private.h')
-rw-r--r--tools/libxc/xc_private.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index aa36d1157b..f360b14022 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -240,18 +240,18 @@ static inline int do_sysctl(xc_interface *xch, struct xen_sysctl *sysctl)
{
int ret = -1;
DECLARE_HYPERCALL;
+ DECLARE_HYPERCALL_BOUNCE(sysctl, sizeof(*sysctl), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
- if ( hcall_buf_prep(xch, (void **)&sysctl, sizeof(*sysctl)) != 0 )
+ sysctl->interface_version = XEN_SYSCTL_INTERFACE_VERSION;
+
+ if ( xc_hypercall_bounce_pre(xch, sysctl) )
{
- PERROR("Could not lock memory for Xen hypercall");
+ PERROR("Could not bounce buffer for sysctl hypercall");
goto out1;
}
- sysctl->interface_version = XEN_SYSCTL_INTERFACE_VERSION;
-
hypercall.op = __HYPERVISOR_sysctl;
- hypercall.arg[0] = (unsigned long)sysctl;
-
+ hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(sysctl);
if ( (ret = do_xen_hypercall(xch, &hypercall)) < 0 )
{
if ( errno == EACCES )
@@ -259,8 +259,7 @@ static inline int do_sysctl(xc_interface *xch, struct xen_sysctl *sysctl)
" rebuild the user-space tool set?\n");
}
- hcall_buf_release(xch, (void **)&sysctl, sizeof(*sysctl));
-
+ xc_hypercall_bounce_post(xch, sysctl);
out1:
return ret;
}