FreeBSD/Linux Kernel Cross Reference
sys/sys/reboot.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1993,1991,1990 Carnegie Mellon University
4 * All Rights Reserved.
5 *
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.
11 *
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.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: reboot.h,v $
29 * Revision 2.8 93/03/11 13:46:40 danner
30 * u_long -> u_int.
31 * [93/03/09 danner]
32 *
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]
36 *
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]
42 *
43 * Revision 2.5 91/05/14 17:40:11 mrt
44 * Correcting copyright
45 *
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]
49 *
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]
55 *
56 */
57
58 /*
59 * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
60 * All rights reserved.
61 *
62 * Redistribution and use in source and binary forms are permitted
63 * provided that the above copyright notice and this paragraph are
64 * duplicated in all such forms and that any documentation,
65 * advertising materials, and other materials related to such
66 * distribution and use acknowledge that the software was developed
67 * by the University of California, Berkeley. The name of the
68 * University may not be used to endorse or promote products derived
69 * from this software without specific prior written permission.
70 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
71 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
72 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
73 *
74 * @(#)reboot.h 7.5 (Berkeley) 6/27/88
75 */
76
77 #ifndef _SYS_REBOOT_H_
78 #define _SYS_REBOOT_H_
79
80 /*
81 * Arguments to reboot system call.
82 * These are converted to switches, and passed to startup program,
83 * and on to init.
84 */
85 #define RB_AUTOBOOT 0 /* flags for system auto-booting itself */
86
87 #define RB_ASKNAME 0x01 /* -a: ask for file name to reboot from */
88 #define RB_SINGLE 0x02 /* -s: reboot to single user only */
89 #define RB_KDB 0x04 /* -d: kernel debugger symbols loaded */
90 #define RB_HALT 0x08 /* -h: enter KDB at bootup */
91 /* for host_reboot(): don't reboot,
92 just halt */
93 #define RB_INITNAME 0x10 /* -i: name given for /etc/init (unused) */
94 #define RB_DFLTROOT 0x20 /* use compiled-in rootdev */
95 #define RB_NOBOOTRC 0x20 /* -b: don't run /etc/rc.boot */
96 #define RB_ALTBOOT 0x40 /* use /boot.old vs /boot */
97 #define RB_UNIPROC 0x80 /* -u: start only one processor */
98
99 #define RB_SHIFT 8 /* second byte is for ux */
100
101 #define RB_DEBUGGER 0x1000 /* for host_reboot(): enter kernel
102 debugger from user level */
103
104 /*
105 * Constants for converting boot-style device number to type,
106 * adaptor (uba, mba, etc), unit number and partition number.
107 * Type (== major device number) is in the low byte
108 * for backward compatibility. Except for that of the "magic
109 * number", each mask applies to the shifted value.
110 * Format:
111 * (4) (4) (4) (4) (8) (8)
112 * --------------------------------
113 * |MA | AD| CT| UN| PART | TYPE |
114 * --------------------------------
115 */
116 #define B_ADAPTORSHIFT 24
117 #define B_ADAPTORMASK 0x0f
118 #define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
119 #define B_CONTROLLERSHIFT 20
120 #define B_CONTROLLERMASK 0xf
121 #define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
122 #define B_UNITSHIFT 16
123 #define B_UNITMASK 0xf
124 #define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK)
125 #define B_PARTITIONSHIFT 8
126 #define B_PARTITIONMASK 0xff
127 #define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
128 #define B_TYPESHIFT 0
129 #define B_TYPEMASK 0xff
130 #define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)
131
132 #define B_MAGICMASK ((u_int)0xf0000000U)
133 #define B_DEVMAGIC ((u_int)0xa0000000U)
134
135 #define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
136 (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
137 ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
138 ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
139
140
141 #ifdef KERNEL
142 #ifndef ASSEMBLER
143 extern int boothowto;
144 #endif ASSEMBLER
145 #endif
146
147 #endif /* _SYS_REBOOT_H_ */
Cache object: 765d609bcf0302d4f00c63ff30f4d445
|