xref: /onnv-gate/usr/src/uts/common/sys/uadmin.h (revision 5295:a21f2449e5f9)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
52267Sdp  * Common Development and Distribution License (the "License").
62267Sdp  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*5295Srandyf  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
270Sstevel@tonic-gate /*	  All Rights Reserved  	*/
280Sstevel@tonic-gate 
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #ifndef _SYS_UADMIN_H
310Sstevel@tonic-gate #define	_SYS_UADMIN_H
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #if !defined(_ASM)
360Sstevel@tonic-gate #include <sys/types.h>
370Sstevel@tonic-gate #include <sys/cred.h>
380Sstevel@tonic-gate #endif
390Sstevel@tonic-gate 
400Sstevel@tonic-gate #ifdef	__cplusplus
410Sstevel@tonic-gate extern "C" {
420Sstevel@tonic-gate #endif
430Sstevel@tonic-gate 
440Sstevel@tonic-gate #define	A_REBOOT	1
450Sstevel@tonic-gate #define	A_SHUTDOWN	2
460Sstevel@tonic-gate #define	A_FREEZE	3	/* For freeze and thaw */
470Sstevel@tonic-gate #define	A_REMOUNT	4
480Sstevel@tonic-gate #define	A_DUMP		5
490Sstevel@tonic-gate #define	A_FTRACE	15
500Sstevel@tonic-gate #define	A_SWAPCTL	16
510Sstevel@tonic-gate /*			17-21	   reserved for obsolete interface */
520Sstevel@tonic-gate 
530Sstevel@tonic-gate #define	AD_HALT		0	/* halt the processor */
540Sstevel@tonic-gate #define	AD_BOOT		1	/* multi-user reboot */
550Sstevel@tonic-gate #define	AD_IBOOT	2	/* multi-user reboot, ask for name of file */
560Sstevel@tonic-gate #define	AD_SBOOT	3	/* single-user reboot */
570Sstevel@tonic-gate #define	AD_SIBOOT	4	/* single-user reboot, ask for name of file */
580Sstevel@tonic-gate #define	AD_POWEROFF	6	/* software poweroff */
590Sstevel@tonic-gate #define	AD_NOSYNC	7	/* do not sync filesystems on next A_DUMP */
600Sstevel@tonic-gate 
61*5295Srandyf 
620Sstevel@tonic-gate /*
630Sstevel@tonic-gate  * Functions reserved for A_FREEZE (may not be available on all platforms)
64*5295Srandyf  * Note:  AD_COMPRESS, AD_CHECK and AD_FORCE are now obsolete
65*5295Srandyf  *	The first two are succeeded by AD_SUSPEND_TO_DISK and
66*5295Srandyf  *		AD_CHECK_SUSPEND_TO_DISK respectively.
67*5295Srandyf  *	AD_FORCE should not be used by any new application
68*5295Srandyf  *
69*5295Srandyf  *	We maintain compatibility with the earlier interfaces:
70*5295Srandyf  *	AD_COMPRESS and AD_CHECK, by preserving those values
71*5295Srandyf  *	in the corresponding new interfaces
720Sstevel@tonic-gate  */
73*5295Srandyf 
740Sstevel@tonic-gate #define	AD_COMPRESS	0	/* store state file compressed during CPR */
750Sstevel@tonic-gate #define	AD_FORCE	1	/* force to do AD_COMPRESS */
760Sstevel@tonic-gate #define	AD_CHECK	2	/* test if CPR module is available */
77*5295Srandyf #define	AD_SUSPEND_TO_DISK	   AD_COMPRESS	/* A_FREEZE, CPR or ACPI S4 */
78*5295Srandyf #define	AD_CHECK_SUSPEND_TO_DISK   AD_CHECK	/* A_FREEZE, CPR/S4 capable? */
79*5295Srandyf #define	AD_SUSPEND_TO_RAM	   20		/* A_FREEZE, S3 */
80*5295Srandyf #define	AD_CHECK_SUSPEND_TO_RAM	   21		/* A_FREEZE, S3 capable? */
81*5295Srandyf 
820Sstevel@tonic-gate /*
830Sstevel@tonic-gate  * NOTE: the following defines comprise an Unstable interface.  Their semantics
840Sstevel@tonic-gate  * may change or they may be removed completely in a later release
850Sstevel@tonic-gate  */
860Sstevel@tonic-gate #define	AD_REUSEINIT	3	/* prepare for AD_REUSABLE */
870Sstevel@tonic-gate #define	AD_REUSABLE	4	/* create reusable statefile */
880Sstevel@tonic-gate #define	AD_REUSEFINI	5	/* revert to normal CPR mode (not reusable) */
890Sstevel@tonic-gate 
900Sstevel@tonic-gate #define	AD_FTRACE_START	1
910Sstevel@tonic-gate #define	AD_FTRACE_STOP	2
920Sstevel@tonic-gate 
932267Sdp /*
942267Sdp  * When 'mdep' (the second argument to uadmin(2)) is initialized for A_REBOOT,
952267Sdp  * A_SHUTDOWN or A_DUMP, it represents the boot arguments string of at most
962267Sdp  * 256 characters.
972267Sdp  */
982267Sdp #define	BOOTARGS_MAX	256
992267Sdp 
1000Sstevel@tonic-gate #if !defined(_ASM)
1010Sstevel@tonic-gate 
1020Sstevel@tonic-gate #if defined(_KERNEL)
1030Sstevel@tonic-gate extern kmutex_t ualock;
104136Sachartre extern void mdboot(int, int, char *, boolean_t);
1050Sstevel@tonic-gate extern void mdpreboot(int, int, char *);
1060Sstevel@tonic-gate extern int kadmin(int, int, void *, cred_t *);
1070Sstevel@tonic-gate extern void killall(zoneid_t);
1080Sstevel@tonic-gate #endif
1090Sstevel@tonic-gate 
1100Sstevel@tonic-gate #if defined(__STDC__)
1110Sstevel@tonic-gate extern int uadmin(int, int, uintptr_t);
1120Sstevel@tonic-gate #else
1130Sstevel@tonic-gate extern int uadmin();
1140Sstevel@tonic-gate #endif
1150Sstevel@tonic-gate 
1160Sstevel@tonic-gate #endif	/* _ASM */
1170Sstevel@tonic-gate 
1180Sstevel@tonic-gate #ifdef	__cplusplus
1190Sstevel@tonic-gate }
1200Sstevel@tonic-gate #endif
1210Sstevel@tonic-gate 
1220Sstevel@tonic-gate #endif	/* _SYS_UADMIN_H */
123