8446 uts: pci_check_bios() should check for BIOS
[unleashed.git] / include / sys / uadmin.h
blob904b52cac4db412c983a5a544def6ce7966264a4
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
28 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
29 /* All Rights Reserved */
32 #ifndef _SYS_UADMIN_H
33 #define _SYS_UADMIN_H
36 #if !defined(_ASM)
37 #include <sys/types.h>
38 #include <sys/cred.h>
39 #endif
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
45 #define A_REBOOT 1
46 #define A_SHUTDOWN 2
47 #define A_FREEZE 3 /* For freeze and thaw */
48 #define A_REMOUNT 4
49 #define A_DUMP 5
50 #define A_FTRACE 15
51 #define A_SWAPCTL 16
52 /* 17-21 reserved for obsolete interface */
53 #define A_SDTTEST 22 /* DTrace sdt:::test */
54 #define A_CONFIG 23 /* For system configuration */
56 #define AD_UNKNOWN -1 /* no method */
57 #define AD_HALT 0 /* halt the processor */
58 #define AD_BOOT 1 /* multi-user reboot */
59 #define AD_IBOOT 2 /* multi-user reboot, ask for name of file */
60 #define AD_SBOOT 3 /* single-user reboot */
61 #define AD_SIBOOT 4 /* single-user reboot, ask for name of file */
62 #define AD_POWEROFF 6 /* software poweroff */
63 #define AD_NOSYNC 7 /* do not sync filesystems on next A_DUMP */
64 #define AD_FASTREBOOT 8 /* bypass firmware and boot loader */
65 #define AD_FASTREBOOT_DRYRUN 9 /* Fast reboot Dry run */
68 * Functions reserved for A_FREEZE (may not be available on all platforms)
69 * Note: AD_COMPRESS, AD_CHECK and AD_FORCE are now obsolete
70 * The first two are succeeded by AD_SUSPEND_TO_DISK and
71 * AD_CHECK_SUSPEND_TO_DISK respectively.
72 * AD_FORCE should not be used by any new application
74 * We maintain compatibility with the earlier interfaces:
75 * AD_COMPRESS and AD_CHECK, by preserving those values
76 * in the corresponding new interfaces
79 #define AD_COMPRESS 0 /* store state file compressed during CPR */
80 #define AD_FORCE 1 /* force to do AD_COMPRESS */
81 #define AD_CHECK 2 /* test if CPR module is available */
82 #define AD_SUSPEND_TO_DISK AD_COMPRESS /* A_FREEZE, CPR or ACPI S4 */
83 #define AD_CHECK_SUSPEND_TO_DISK AD_CHECK /* A_FREEZE, CPR/S4 capable? */
84 #define AD_SUSPEND_TO_RAM 20 /* A_FREEZE, S3 */
85 #define AD_CHECK_SUSPEND_TO_RAM 21 /* A_FREEZE, S3 capable? */
88 * NOTE: the following defines comprise an Unstable interface. Their semantics
89 * may change or they may be removed completely in a later release
91 #define AD_REUSEINIT 3 /* prepare for AD_REUSABLE */
92 #define AD_REUSABLE 4 /* create reusable statefile */
93 #define AD_REUSEFINI 5 /* revert to normal CPR mode (not reusable) */
95 #define AD_FTRACE_START 1
96 #define AD_FTRACE_STOP 2
99 * Functions of A_CONFIG. Unstable interface.
101 #define AD_UPDATE_BOOT_CONFIG 1 /* Update boot config variables */
104 * When 'mdep' (the second argument to uadmin(2)) is initialized for A_REBOOT,
105 * A_SHUTDOWN or A_DUMP, it represents the boot arguments string of at most
106 * 256 characters.
108 #define BOOTARGS_MAX 256
110 #if !defined(_KERNEL)
112 * FMRI for boot-config service.
114 #define FMRI_BOOT_CONFIG \
115 "svc:/system/boot-config:default"
118 * Property group that contains all Fast Reboot configuration properties.
120 #define BOOT_CONFIG_PG_PARAMS "config"
123 * Property group that contains all Fast Reboot blacklisting information.
125 #define BOOT_CONFIG_PG_FBBLACKLIST "fastreboot_blacklist"
128 * Non-persistent property group which contains all the properties that
129 * will override settings in the BOOT_CONFIG_PG_PARAMS property group.
131 #define BOOT_CONFIG_PG_OVR "config_ovr"
133 #endif /* _KERNEL */
136 * Flag representations of fastboot configuration.
138 #define UA_FASTREBOOT_DEFAULT 0x01
139 #define UA_FASTREBOOT_ONPANIC 0x02
141 #define FASTREBOOT_DEFAULT "fastreboot_default"
142 #define FASTREBOOT_ONPANIC "fastreboot_onpanic"
143 #define FASTREBOOT_ONPANIC_CMDLINE "fastreboot_onpanic_cmdline"
145 #define FASTREBOOT_ONPANIC_NOTSET(p) \
146 (strcmp((p), "false") == 0 || \
147 strcmp((p), "no") == 0 || \
148 strcmp((p), "0") == 0)
150 #define FASTREBOOT_ONPANIC_ISSET(p) \
151 (strcmp((p), "true") == 0 || \
152 strcmp((p), "yes") == 0 || \
153 strcmp((p), "1") == 0)
155 #if !defined(_ASM)
157 #if defined(_KERNEL)
158 extern kmutex_t ualock;
159 extern void mdboot(int, int, char *, boolean_t);
160 extern void mdpreboot(int, int, char *);
161 extern int kadmin(int, int, void *, cred_t *);
162 extern void killall(zoneid_t);
163 #endif
165 extern int uadmin(int, int, uintptr_t);
167 #endif /* _ASM */
169 #ifdef __cplusplus
171 #endif
173 #endif /* _SYS_UADMIN_H */