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