# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1287756891 -3600
# Node ID f0caf8b361c4093f4f9efd32b24be303563dffa4
# Parent f18c32d6be8c2833b7346f2c06c81855d1c7c6a7
libxc: convert flask interfaces over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/libxc/xc_flask.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff -r f18c32d6be8c -r f0caf8b361c4 tools/libxc/xc_flask.c
--- a/tools/libxc/xc_flask.c Fri Oct 22 15:14:51 2010 +0100
+++ b/tools/libxc/xc_flask.c Fri Oct 22 15:14:51 2010 +0100
@@ -40,15 +40,16 @@ int xc_flask_op(xc_interface *xch, flask
{
int ret = -1;
DECLARE_HYPERCALL;
+ DECLARE_HYPERCALL_BOUNCE(op, sizeof(*op), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
+
+ if ( xc_hypercall_bounce_pre(xch, op) )
+ {
+ PERROR("Could not bounce memory for flask op hypercall");
+ goto out;
+ }
hypercall.op = __HYPERVISOR_xsm_op;
- hypercall.arg[0] = (unsigned long)op;
-
- if ( lock_pages(xch, op, sizeof(*op)) != 0 )
- {
- PERROR("Could not lock memory for Xen hypercall");
- goto out;
- }
+ hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(op);
if ( (ret = do_xen_hypercall(xch, &hypercall)) < 0 )
{
@@ -56,7 +57,7 @@ int xc_flask_op(xc_interface *xch, flask
fprintf(stderr, "XSM operation failed!\n");
}
- unlock_pages(xch, op, sizeof(*op));
+ xc_hypercall_bounce_post(xch, op);
out:
return ret;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|