(__getline): Define.
[glibc/history.git] / sysdeps / mach / sys / reboot.h
blobfc7308929b15bbe8024d6e607f14e8b4ae1b52c4
1 /*
2 * Mach Operating System
3 * Copyright (C) 1993,1991,1990 Carnegie Mellon University
4 * All Rights Reserved.
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
16 * Carnegie Mellon requests users of this software to return to
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
27 * (pre-GNU) HISTORY
29 * Revision 2.8 93/03/11 13:46:40 danner
30 * u_long -> u_int.
31 * [93/03/09 danner]
33 * Revision 2.7 92/05/21 17:25:11 jfriedl
34 * Appended 'U' to constants that would otherwise be signed.
35 * [92/05/16 jfriedl]
37 * Revision 2.6 91/06/19 11:59:44 rvb
38 * Second byte of boothowto is flags for "startup" program.
39 * [91/06/18 rvb]
40 * Add ifndef __ASSEMBLER__ so that vax_init.s can include it.
41 * [91/06/11 rvb]
43 * Revision 2.5 91/05/14 17:40:11 mrt
44 * Correcting copyright
46 * Revision 2.4 91/02/05 17:56:48 mrt
47 * Changed to new Mach copyright
48 * [91/02/01 17:49:12 mrt]
50 * Revision 2.3 90/08/27 22:12:56 dbg
51 * Added definitions used by Mach Kernel: RB_DEBUGGER, RB_UNIPROC,
52 * RB_NOBOOTRC, RB_ALTBOOT. Moved RB_KDB to 0x04 (Mach value).
53 * Removed RB_RDONLY, RB_DUMP, RB_NOSYNC.
54 * [90/08/14 dbg]
59 Copyright (C) 1982, 1986, 1988 Regents of the University of California.
60 All rights reserved.
62 Redistribution and use in source and binary forms, with or without
63 modification, are permitted provided that the following conditions
64 are met:
66 1. Redistributions of source code must retain the above copyright
67 notice, this list of conditions and the following disclaimer.
68 2. Redistributions in binary form must reproduce the above copyright
69 notice, this list of conditions and the following disclaimer in the
70 documentation and/or other materials provided with the distribution.
71 4. Neither the name of the University nor the names of its contributors
72 may be used to endorse or promote products derived from this software
73 without specific prior written permission.
75 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
76 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
77 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
78 ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
79 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
80 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
81 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
82 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
83 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
84 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
85 SUCH DAMAGE.*/
88 * @(#)reboot.h 7.5 (Berkeley) 6/27/88
91 #ifndef _SYS_REBOOT_H_
92 #define _SYS_REBOOT_H_
94 #include <features.h>
97 * Arguments to reboot system call.
98 * These are converted to switches, and passed to startup program,
99 * and on to init.
101 #define RB_AUTOBOOT 0 /* flags for system auto-booting itself */
103 #define RB_ASKNAME 0x01 /* -a: ask for file name to reboot from */
104 #define RB_SINGLE 0x02 /* -s: reboot to single user only */
105 #define RB_KDB 0x04 /* -d: kernel debugger symbols loaded */
106 #define RB_HALT 0x08 /* -h: enter KDB at bootup */
107 /* for host_reboot(): don't reboot,
108 just halt */
109 #define RB_INITNAME 0x10 /* -i: name given for /etc/init (unused) */
110 #define RB_DFLTROOT 0x20 /* use compiled-in rootdev */
111 #define RB_NOBOOTRC 0x20 /* -b: don't run /etc/rc.boot */
112 #define RB_ALTBOOT 0x40 /* use /boot.old vs /boot */
113 #define RB_UNIPROC 0x80 /* -u: start only one processor */
115 #define RB_SHIFT 8 /* second byte is for ux */
117 #define RB_DEBUGGER 0x1000 /* for host_reboot(): enter kernel
118 debugger from user level */
121 * Constants for converting boot-style device number to type,
122 * adaptor (uba, mba, etc), unit number and partition number.
123 * Type (== major device number) is in the low byte
124 * for backward compatibility. Except for that of the "magic
125 * number", each mask applies to the shifted value.
126 * Format:
127 * (4) (4) (4) (4) (8) (8)
128 * --------------------------------
129 * |MA | AD| CT| UN| PART | TYPE |
130 * --------------------------------
132 #define B_ADAPTORSHIFT 24
133 #define B_ADAPTORMASK 0x0f
134 #define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
135 #define B_CONTROLLERSHIFT 20
136 #define B_CONTROLLERMASK 0xf
137 #define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
138 #define B_UNITSHIFT 16
139 #define B_UNITMASK 0xf
140 #define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK)
141 #define B_PARTITIONSHIFT 8
142 #define B_PARTITIONMASK 0xff
143 #define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
144 #define B_TYPESHIFT 0
145 #define B_TYPEMASK 0xff
146 #define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)
148 #define B_MAGICMASK ((u_int)0xf0000000U)
149 #define B_DEVMAGIC ((u_int)0xa0000000U)
151 #define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
152 (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
153 ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
154 ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
157 #ifdef KERNEL
158 #ifndef __ASSEMBLER__
159 extern int boothowto;
160 #endif /* __ASSEMBLER__ */
161 #endif
163 __BEGIN_DECLS
165 /* Reboot or halt the system. */
166 extern int reboot (int __howto) __THROW;
168 __END_DECLS
171 #endif /* _SYS_REBOOT_H_ */