debuggers.hg

view tools/libxc/xc_flask.c @ 21067:b4a1832a916f

Update Xen version to 4.0.0-rc6
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 09 18:18:05 2010 +0000 (2010-03-09)
parents 789e4303b330
children 3ffdb094c2c0 779c0ef9682c
line source
1 /******************************************************************************
2 * xc_flask.c
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, version 2 of the
7 * License.
8 */
10 #include "xc_private.h"
12 int xc_flask_op(int xc_handle, flask_op_t *op)
13 {
14 int ret = -1;
15 DECLARE_HYPERCALL;
17 hypercall.op = __HYPERVISOR_xsm_op;
18 hypercall.arg[0] = (unsigned long)op;
20 if ( mlock(op, sizeof(*op)) != 0 )
21 {
22 PERROR("Could not lock memory for Xen hypercall");
23 goto out;
24 }
26 if ( (ret = do_xen_hypercall(xc_handle, &hypercall)) < 0 )
27 {
28 if ( errno == EACCES )
29 fprintf(stderr, "XSM operation failed!\n");
30 }
32 safe_munlock(op, sizeof(*op));
34 out:
35 return ret;
36 }
38 /*
39 * Local variables:
40 * mode: C
41 * c-set-style: "BSD"
42 * c-basic-offset: 4
43 * tab-width: 4
44 * indent-tabs-mode: nil
45 * End:
46 */