xref: /original-bsd/sys/sys/reboot.h (revision 0997b878)
1 /*
2  * Copyright (c) 1982, 1986, 1988, 1993, 1994
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)reboot.h	8.3 (Berkeley) 12/13/94
8  */
9 
10 /*
11  * Arguments to reboot system call.  These are passed to
12  * the boot program and on to init.
13  */
14 #define	RB_AUTOBOOT	0	/* flags for system auto-booting itself */
15 
16 #define	RB_ASKNAME	0x001	/* ask for file name to reboot from */
17 #define	RB_SINGLE	0x002	/* reboot to single user only */
18 #define	RB_NOSYNC	0x004	/* dont sync before reboot */
19 #define	RB_HALT		0x008	/* don't reboot, just halt */
20 #define	RB_INITNAME	0x010	/* name given for /etc/init (unused) */
21 #define	RB_DFLTROOT	0x020	/* use compiled-in rootdev */
22 #define	RB_KDB		0x040	/* give control to kernel debugger */
23 #define	RB_RDONLY	0x080	/* mount root fs read-only */
24 #define	RB_DUMP		0x100	/* dump kernel memory before reboot */
25 #define	RB_MINIROOT	0x200	/* mini-root present in memory at boot time */
26 
27 /*
28  * Constants for converting boot-style device number to type,
29  * adaptor (uba, mba, etc), unit number and partition number.
30  * Type (== major device number) is in the low byte
31  * for backward compatibility.  Except for that of the "magic
32  * number", each mask applies to the shifted value.
33  * Format:
34  *	 (4) (4) (4) (4)  (8)     (8)
35  *	--------------------------------
36  *	|MA | AD| CT| UN| PART  | TYPE |
37  *	--------------------------------
38  */
39 #define	B_ADAPTORSHIFT		24
40 #define	B_ADAPTORMASK		0x0f
41 #define	B_ADAPTOR(val)		(((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
42 #define B_CONTROLLERSHIFT	20
43 #define B_CONTROLLERMASK	0xf
44 #define	B_CONTROLLER(val)	(((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
45 #define B_UNITSHIFT		16
46 #define B_UNITMASK		0xf
47 #define	B_UNIT(val)		(((val) >> B_UNITSHIFT) & B_UNITMASK)
48 #define B_PARTITIONSHIFT	8
49 #define B_PARTITIONMASK		0xff
50 #define	B_PARTITION(val)	(((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
51 #define	B_TYPESHIFT		0
52 #define	B_TYPEMASK		0xff
53 #define	B_TYPE(val)		(((val) >> B_TYPESHIFT) & B_TYPEMASK)
54 
55 #define	B_MAGICMASK	0xf0000000
56 #define	B_DEVMAGIC	0xa0000000
57 
58 #define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
59 	(((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
60 	((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
61 	((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
62