direct-io.hg

view tools/libxc/xc_acm.c @ 10057:0f16f0871dc9

[ACM] Replace the union structure parameter of the ACM hypercalls
with command-specific request structures. It aligns the ACM
hypercalls with the way parameters are passed in the event channel
hypercalls.

Advantages include backward-compatibility regarding old guests when
new calls are added and clarity of the code.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun May 21 19:05:31 2006 +0100 (2006-05-21)
parents 24dbb153ab39
children e292f0df2d96
line source
1 /******************************************************************************
2 * xc_acm.c
3 *
4 * Copyright (C) 2005, 2006 IBM Corporation, R Sailer
5 *
6 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
7 * Use is subject to license terms.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation, version 2 of the
12 * License.
13 */
15 #include "xc_private.h"
18 int xc_acm_op(int xc_handle, int cmd, void *arg, size_t arg_size)
19 {
20 int ret = -1;
21 DECLARE_HYPERCALL;
23 hypercall.op = __HYPERVISOR_acm_op;
24 hypercall.arg[0] = cmd;
25 hypercall.arg[1] = (unsigned long) arg;
27 if (mlock(arg, arg_size) != 0) {
28 PERROR("xc_acm_op: arg mlock failed");
29 goto out;
30 }
31 ret = do_xen_hypercall(xc_handle, &hypercall);
32 safe_munlock(arg, arg_size);
33 out:
34 return ret;
35 }
37 /*
38 * Local variables:
39 * mode: C
40 * c-set-style: "BSD"
41 * c-basic-offset: 4
42 * tab-width: 4
43 * indent-tabs-mode: nil
44 * End:
45 */