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]
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 */
37 #include <sys/types.h>
47 #define A_FREEZE 3 /* For freeze and thaw */
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)
71 #define AD_SUSPEND_TO_DISK 0 /* A_FREEZE, CPR or ACPI S4 */
72 #define AD_CHECK_SUSPEND_TO_DISK 2 /* A_FREEZE, CPR/S4 capable? */
73 #define AD_SUSPEND_TO_RAM 20 /* A_FREEZE, S3 */
74 #define AD_CHECK_SUSPEND_TO_RAM 21 /* A_FREEZE, S3 capable? */
77 * NOTE: the following defines comprise an Unstable interface. Their semantics
78 * may change or they may be removed completely in a later release
80 #define AD_REUSEINIT 3 /* prepare for AD_REUSABLE */
81 #define AD_REUSABLE 4 /* create reusable statefile */
82 #define AD_REUSEFINI 5 /* revert to normal CPR mode (not reusable) */
84 #define AD_FTRACE_START 1
85 #define AD_FTRACE_STOP 2
88 * Functions of A_CONFIG. Unstable interface.
90 #define AD_UPDATE_BOOT_CONFIG 1 /* Update boot config variables */
93 * When 'mdep' (the second argument to uadmin(2)) is initialized for A_REBOOT,
94 * A_SHUTDOWN or A_DUMP, it represents the boot arguments string of at most
97 #define BOOTARGS_MAX 256
101 * FMRI for boot-config service.
103 #define FMRI_BOOT_CONFIG \
104 "svc:/system/boot-config:default"
107 * Property group that contains all Fast Reboot configuration properties.
109 #define BOOT_CONFIG_PG_PARAMS "config"
112 * Property group that contains all Fast Reboot blacklisting information.
114 #define BOOT_CONFIG_PG_FBBLACKLIST "fastreboot_blacklist"
117 * Non-persistent property group which contains all the properties that
118 * will override settings in the BOOT_CONFIG_PG_PARAMS property group.
120 #define BOOT_CONFIG_PG_OVR "config_ovr"
125 * Flag representations of fastboot configuration.
127 #define UA_FASTREBOOT_DEFAULT 0x01
128 #define UA_FASTREBOOT_ONPANIC 0x02
130 #define FASTREBOOT_DEFAULT "fastreboot_default"
131 #define FASTREBOOT_ONPANIC "fastreboot_onpanic"
132 #define FASTREBOOT_ONPANIC_CMDLINE "fastreboot_onpanic_cmdline"
134 #define FASTREBOOT_ONPANIC_NOTSET(p) \
135 (strcmp((p), "false") == 0 || \
136 strcmp((p), "no") == 0 || \
137 strcmp((p), "0") == 0)
139 #define FASTREBOOT_ONPANIC_ISSET(p) \
140 (strcmp((p), "true") == 0 || \
141 strcmp((p), "yes") == 0 || \
142 strcmp((p), "1") == 0)
147 extern kmutex_t ualock
;
148 extern void mdboot(int, int, char *, boolean_t
);
149 extern void mdpreboot(int, int, char *);
150 extern int kadmin(int, int, void *, cred_t
*);
151 extern void killall(zoneid_t
);
154 extern int uadmin(int, int, uintptr_t);
162 #endif /* _SYS_UADMIN_H */