xref: /original-bsd/sys/sys/reboot.h (revision abd50c55)
1 /*
2  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that the above copyright notice and this paragraph are
7  * duplicated in all such forms and that any documentation,
8  * advertising materials, and other materials related to such
9  * distribution and use acknowledge that the software was developed
10  * by the University of California, Berkeley.  The name of the
11  * University may not be used to endorse or promote products derived
12  * from this software without specific prior written permission.
13  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  *	@(#)reboot.h	7.5 (Berkeley) 06/27/88
18  */
19 
20 /*
21  * Arguments to reboot system call.
22  * These are passed to boot program in r11,
23  * and on to init.
24  */
25 #define	RB_AUTOBOOT	0	/* flags for system auto-booting itself */
26 
27 #define	RB_ASKNAME	0x01	/* ask for file name to reboot from */
28 #define	RB_SINGLE	0x02	/* reboot to single user only */
29 #define	RB_NOSYNC	0x04	/* dont sync before reboot */
30 #define	RB_HALT		0x08	/* don't reboot, just halt */
31 #define	RB_INITNAME	0x10	/* name given for /etc/init (unused) */
32 #define	RB_DFLTROOT	0x20	/* use compiled-in rootdev */
33 #define	RB_KDB		0x40	/* give control to kernel debugger */
34 #define	RB_RDONLY	0x80	/* mount root fs read-only */
35 #define	RB_DUMP		0x100	/* dump kernel memory before reboot */
36 
37 /*
38  * Constants for converting boot-style device number to type,
39  * adaptor (uba, mba, etc), unit number and partition number.
40  * Type (== major device number) is in the low byte
41  * for backward compatibility.  Except for that of the "magic
42  * number", each mask applies to the shifted value.
43  * Format:
44  *	 (4) (4) (4) (4)  (8)     (8)
45  *	--------------------------------
46  *	|MA | AD| CT| UN| PART  | TYPE |
47  *	--------------------------------
48  */
49 #define	B_ADAPTORSHIFT		24
50 #define	B_ADAPTORMASK		0x0f
51 #define	B_ADAPTOR(val)		(((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
52 #define B_CONTROLLERSHIFT	20
53 #define B_CONTROLLERMASK	0xf
54 #define	B_CONTROLLER(val)	(((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
55 #define B_UNITSHIFT		16
56 #define B_UNITMASK		0xf
57 #define	B_UNIT(val)		(((val) >> B_UNITSHIFT) & B_UNITMASK)
58 #define B_PARTITIONSHIFT	8
59 #define B_PARTITIONMASK		0xff
60 #define	B_PARTITION(val)	(((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
61 #define	B_TYPESHIFT		0
62 #define	B_TYPEMASK		0xff
63 #define	B_TYPE(val)		(((val) >> B_TYPESHIFT) & B_TYPEMASK)
64 
65 #define	B_MAGICMASK	((u_long)0xf0000000)
66 #define	B_DEVMAGIC	((u_long)0xa0000000)
67 
68 #define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
69 	(((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
70 	((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
71 	((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
72