xref: /titanic_50/usr/src/uts/i86xpv/sys/xpv_user.h (revision 0b5ce10aee80822ecc7df77df92a5e24078ba196)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SYS_XPV_SYSCTL_H
27 #define	_SYS_XPV_SYSCTL_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /*
34  * This header file defines things needed for access to sysctl(),
35  * domctl(), and other API features that are only used by userspace
36  * upstream.  On Solaris, due to privcmd and a couple of other uses, we
37  * need them in the kernel, so isolate their use to this file.
38  */
39 
40 #define	__XEN_TOOLS__
41 
42 #include <sys/hypervisor.h>
43 #include <xen/public/sysctl.h>
44 #include <xen/public/xsm/acm_ops.h>
45 
46 
47 #if !defined(__GNUC__) && defined(__i386__)
48 #define	set_xen_guest_handle_u(hnd, val)  do { (hnd).u.p = val; } while (0)
49 #define	get_xen_guest_handle_u(val, hnd)  do { val = (hnd).u.p; } while (0)
50 #else
51 #define	set_xen_guest_handle_u(hnd, val)  do { (hnd).p = val; } while (0)
52 #define	get_xen_guest_handle_u(val, hnd)  do { val = (hnd).p; } while (0)
53 #endif
54 
55 extern long HYPERVISOR_xsm_op(struct xen_acmctl *);
56 extern long HYPERVISOR_sysctl(xen_sysctl_t *);
57 extern long HYPERVISOR_domctl(xen_domctl_t *domctl);
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif	/* _SYS_XPV_SYSCTL_H */
64