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