|
|
1.1 root 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 [email protected]
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: * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
28: * All rights reserved.
29: *
30: * Redistribution and use in source and binary forms are permitted
31: * provided that the above copyright notice and this paragraph are
32: * duplicated in all such forms and that any documentation,
33: * advertising materials, and other materials related to such
34: * distribution and use acknowledge that the software was developed
35: * by the University of California, Berkeley. The name of the
36: * University may not be used to endorse or promote products derived
37: * from this software without specific prior written permission.
38: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
39: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
40: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
41: *
42: * @(#)reboot.h 7.5 (Berkeley) 6/27/88
43: */
44: /*
45: * Warning: The contents of this file are deprecated;
46: * it should only ever be used for BSD and Mach 3 compatibility.
47: * As the above copyright notice suggests, this file originated in BSD;
48: * it is mostly the same, except the flags after RB_DFLTROOT
49: * have diverged from BSD.
50: */
51: #ifndef _MACH_SYS_REBOOT_H_
52: #define _MACH_SYS_REBOOT_H_
53:
54: /*
55: * Arguments to reboot system call.
56: * These are converted to switches, and passed to startup program,
57: * and on to init.
58: */
59: #define RB_AUTOBOOT 0 /* flags for system auto-booting itself */
60:
61: #define RB_ASKNAME 0x01 /* -a: ask for file name to reboot from */
62: #define RB_SINGLE 0x02 /* -s: reboot to single user only */
63: #define RB_KDB 0x04 /* -d: kernel debugger symbols loaded */
64: #define RB_HALT 0x08 /* -h: enter KDB at bootup */
65: /* for host_reboot(): don't reboot,
66: just halt */
67: #define RB_INITNAME 0x10 /* -i: name given for /etc/init (unused) */
68: #define RB_DFLTROOT 0x20 /* use compiled-in rootdev */
69: #define RB_NOBOOTRC 0x20 /* -b: don't run /etc/rc.boot */
70: #define RB_ALTBOOT 0x40 /* use /boot.old vs /boot */
71: #define RB_UNIPROC 0x80 /* -u: start only one processor */
72:
73: #define RB_SHIFT 8 /* second byte is for ux */
74:
75: #define RB_DEBUGGER 0x1000 /* for host_reboot(): enter kernel
76: debugger from user level */
77:
78: /* Corresponding BSD definitions, where they disagree with the Mach flags. */
79: #define BSD_RB_NOSYNC 0x04 /* dont sync before reboot */
80: #define BSD_RB_KDB 0x40 /* give control to kernel debugger */
81: #define BSD_RB_RDONLY 0x80 /* mount root fs read-only */
82: #define BSD_RB_DUMP 0x100 /* dump kernel memory before reboot */
83: #define BSD_RB_MINIROOT 0x200 /* mini-root present in memory at boot time */
84: #define BSD_RB_CONFIG 0x400 /* invoke user configuration routing */
85:
86:
87: /*
88: * Constants for converting boot-style device number to type,
89: * adaptor (uba, mba, etc), unit number and partition number.
90: * Type (== major device number) is in the low byte
91: * for backward compatibility. Except for that of the "magic
92: * number", each mask applies to the shifted value.
93: * Format:
94: * (4) (4) (4) (4) (8) (8)
95: * --------------------------------
96: * |MA | AD| CT| UN| PART | TYPE |
97: * --------------------------------
98: */
99: #define B_ADAPTORSHIFT 24
100: #define B_ADAPTORMASK 0x0f
101: #define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
102: #define B_CONTROLLERSHIFT 20
103: #define B_CONTROLLERMASK 0xf
104: #define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
105: #define B_UNITSHIFT 16
106: #define B_UNITMASK 0xf
107: #define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK)
108: #define B_PARTITIONSHIFT 8
109: #define B_PARTITIONMASK 0xff
110: #define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
111: #define B_TYPESHIFT 0
112: #define B_TYPEMASK 0xff
113: #define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)
114:
115: #define B_MAGICMASK ((u_int)0xf0000000U)
116: #define B_DEVMAGIC ((u_int)0xa0000000U)
117:
118: #define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
119: (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
120: ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
121: ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
122:
123: #endif /* _MACH_SYS_REBOOT_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.