xref: /illumos-gate/usr/src/uts/common/sys/uadmin.h (revision 3db86aab)
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 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
27 /*	  All Rights Reserved  	*/
28 
29 
30 #ifndef _SYS_UADMIN_H
31 #define	_SYS_UADMIN_H
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 #if !defined(_ASM)
36 #include <sys/types.h>
37 #include <sys/cred.h>
38 #endif
39 
40 #ifdef	__cplusplus
41 extern "C" {
42 #endif
43 
44 #define	A_REBOOT	1
45 #define	A_SHUTDOWN	2
46 #define	A_FREEZE	3	/* For freeze and thaw */
47 #define	A_REMOUNT	4
48 #define	A_DUMP		5
49 #define	A_FTRACE	15
50 #define	A_SWAPCTL	16
51 /*			17-21	   reserved for obsolete interface */
52 
53 #define	AD_HALT		0	/* halt the processor */
54 #define	AD_BOOT		1	/* multi-user reboot */
55 #define	AD_IBOOT	2	/* multi-user reboot, ask for name of file */
56 #define	AD_SBOOT	3	/* single-user reboot */
57 #define	AD_SIBOOT	4	/* single-user reboot, ask for name of file */
58 #define	AD_POWEROFF	6	/* software poweroff */
59 #define	AD_NOSYNC	7	/* do not sync filesystems on next A_DUMP */
60 
61 /*
62  * Functions reserved for A_FREEZE (may not be available on all platforms)
63  */
64 #define	AD_COMPRESS	0	/* store state file compressed during CPR */
65 #define	AD_FORCE	1	/* force to do AD_COMPRESS */
66 #define	AD_CHECK	2	/* test if CPR module is available */
67 /*
68  * NOTE: the following defines comprise an Unstable interface.  Their semantics
69  * may change or they may be removed completely in a later release
70  */
71 #define	AD_REUSEINIT	3	/* prepare for AD_REUSABLE */
72 #define	AD_REUSABLE	4	/* create reusable statefile */
73 #define	AD_REUSEFINI	5	/* revert to normal CPR mode (not reusable) */
74 
75 #define	AD_FTRACE_START	1
76 #define	AD_FTRACE_STOP	2
77 
78 /*
79  * When 'mdep' (the second argument to uadmin(2)) is initialized for A_REBOOT,
80  * A_SHUTDOWN or A_DUMP, it represents the boot arguments string of at most
81  * 256 characters.
82  */
83 #define	BOOTARGS_MAX	256
84 
85 #if !defined(_ASM)
86 
87 #if defined(_KERNEL)
88 extern kmutex_t ualock;
89 extern void mdboot(int, int, char *, boolean_t);
90 extern void mdpreboot(int, int, char *);
91 extern int kadmin(int, int, void *, cred_t *);
92 extern void killall(zoneid_t);
93 #endif
94 
95 #if defined(__STDC__)
96 extern int uadmin(int, int, uintptr_t);
97 #else
98 extern int uadmin();
99 #endif
100 
101 #endif	/* _ASM */
102 
103 #ifdef	__cplusplus
104 }
105 #endif
106 
107 #endif	/* _SYS_UADMIN_H */
108