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