xref: /freebsd/stand/common/rbx.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
1*ca987d46SWarner Losh /*-
2*ca987d46SWarner Losh  * Copyright (c) 1998 Robert Nordier
3*ca987d46SWarner Losh  * All rights reserved.
4*ca987d46SWarner Losh  *
5*ca987d46SWarner Losh  * Redistribution and use in source and binary forms are freely
6*ca987d46SWarner Losh  * permitted provided that the above copyright notice and this
7*ca987d46SWarner Losh  * paragraph and the following disclaimer are duplicated in all
8*ca987d46SWarner Losh  * such forms.
9*ca987d46SWarner Losh  *
10*ca987d46SWarner Losh  * This software is provided "AS IS" and without any express or
11*ca987d46SWarner Losh  * implied warranties, including, without limitation, the implied
12*ca987d46SWarner Losh  * warranties of merchantability and fitness for a particular
13*ca987d46SWarner Losh  * purpose.
14*ca987d46SWarner Losh  */
15*ca987d46SWarner Losh 
16*ca987d46SWarner Losh #ifndef _RBX_H_
17*ca987d46SWarner Losh #define	_RBX_H_
18*ca987d46SWarner Losh 
19*ca987d46SWarner Losh #define RBX_ASKNAME	0x0	/* -a */
20*ca987d46SWarner Losh #define RBX_SINGLE	0x1	/* -s */
21*ca987d46SWarner Losh /* 0x2 is reserved for log2(RB_NOSYNC). */
22*ca987d46SWarner Losh /* 0x3 is reserved for log2(RB_HALT). */
23*ca987d46SWarner Losh /* 0x4 is reserved for log2(RB_INITNAME). */
24*ca987d46SWarner Losh #define RBX_DFLTROOT	0x5	/* -r */
25*ca987d46SWarner Losh #define RBX_KDB 	0x6	/* -d */
26*ca987d46SWarner Losh /* 0x7 is reserved for log2(RB_RDONLY). */
27*ca987d46SWarner Losh /* 0x8 is reserved for log2(RB_DUMP). */
28*ca987d46SWarner Losh /* 0x9 is reserved for log2(RB_MINIROOT). */
29*ca987d46SWarner Losh #define RBX_CONFIG	0xa	/* -c */
30*ca987d46SWarner Losh #define RBX_VERBOSE	0xb	/* -v */
31*ca987d46SWarner Losh #define RBX_SERIAL	0xc	/* -h */
32*ca987d46SWarner Losh #define RBX_CDROM	0xd	/* -C */
33*ca987d46SWarner Losh /* 0xe is reserved for log2(RB_POWEROFF). */
34*ca987d46SWarner Losh #define RBX_GDB 	0xf	/* -g */
35*ca987d46SWarner Losh #define RBX_MUTE	0x10	/* -m */
36*ca987d46SWarner Losh /* 0x11 is reserved for log2(RB_SELFTEST). */
37*ca987d46SWarner Losh /* 0x12 is reserved for boot programs. */
38*ca987d46SWarner Losh /* 0x13 is reserved for boot programs. */
39*ca987d46SWarner Losh #define RBX_PAUSE	0x14	/* -p */
40*ca987d46SWarner Losh #define RBX_QUIET	0x15	/* -q */
41*ca987d46SWarner Losh #define RBX_NOINTR	0x1c	/* -n */
42*ca987d46SWarner Losh /* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */
43*ca987d46SWarner Losh #define RBX_DUAL	0x1d	/* -D */
44*ca987d46SWarner Losh /* 0x1f is reserved for log2(RB_BOOTINFO). */
45*ca987d46SWarner Losh 
46*ca987d46SWarner Losh /* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */
47*ca987d46SWarner Losh #define RBX_MASK	(OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \
48*ca987d46SWarner Losh 			OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \
49*ca987d46SWarner Losh 			OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \
50*ca987d46SWarner Losh 			OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \
51*ca987d46SWarner Losh 			OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \
52*ca987d46SWarner Losh 			OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL))
53*ca987d46SWarner Losh 
54*ca987d46SWarner Losh #define OPT_SET(opt)	(1 << (opt))
55*ca987d46SWarner Losh #define OPT_CHECK(opt)	((opts) & OPT_SET(opt))
56*ca987d46SWarner Losh 
57*ca987d46SWarner Losh extern uint32_t opts;
58*ca987d46SWarner Losh 
59*ca987d46SWarner Losh #endif	/* !_RBX_H_ */
60