Core integer types header file reorganization stage 1/2: Create and/or modify
[dragonfly.git] / sys / i386 / boot / dosboot / reboot.h
1 /*\r
2  * Copyright (c) 1982, 1986, 1988, 1993\r
3  *      The Regents of the University of California.  All rights reserved.\r
4  *\r
5  * Redistribution and use in source and binary forms, with or without\r
6  * modification, are permitted provided that the following conditions\r
7  * are met:\r
8  * 1. Redistributions of source code must retain the above copyright\r
9  *    notice, this list of conditions and the following disclaimer.\r
10  * 2. Redistributions in binary form must reproduce the above copyright\r
11  *    notice, this list of conditions and the following disclaimer in the\r
12  *    documentation and/or other materials provided with the distribution.\r
13  * 3. All advertising materials mentioning features or use of this software\r
14  *    must display the following acknowledgement:\r
15  *      This product includes software developed by the University of\r
16  *      California, Berkeley and its contributors.\r
17  * 4. Neither the name of the University nor the names of its contributors\r
18  *    may be used to endorse or promote products derived from this software\r
19  *    without specific prior written permission.\r
20  *\r
21  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
31  * SUCH DAMAGE.\r
32  *\r
33  *      @(#)reboot.h    8.1 (Berkeley) 6/2/93\r
34  * $FreeBSD: src/sys/i386/boot/dosboot/reboot.h,v 1.6 1999/08/28 00:43:24 peter Exp $\r
35  * $DragonFly: src/sys/i386/boot/dosboot/Attic/reboot.h,v 1.2 2003/06/17 04:28:34 dillon Exp $\r
36  */\r
37 \r
38 #ifndef _SYS_REBOOT_H_\r
39 #define _SYS_REBOOT_H_\r
40 \r
41 /*\r
42  * Arguments to reboot system call.\r
43  * These are passed to boot program in r11,\r
44  * and on to init.\r
45  */\r
46 #define RB_AUTOBOOT     0       /* flags for system auto-booting itself */\r
47 \r
48 #define RB_ASKNAME      0x01    /* ask for file name to reboot from */\r
49 #define RB_SINGLE       0x02    /* reboot to single user only */\r
50 #define RB_NOSYNC       0x04    /* dont sync before reboot */\r
51 #define RB_HALT         0x08    /* don't reboot, just halt */\r
52 #define RB_INITNAME     0x10    /* name given for /etc/init (unused) */\r
53 #define RB_DFLTROOT     0x20    /* use compiled-in rootdev */\r
54 #define RB_KDB          0x40    /* give control to kernel debugger */\r
55 #define RB_RDONLY       0x80    /* mount root fs read-only */\r
56 #define RB_DUMP         0x100   /* dump kernel memory before reboot */\r
57 #define RB_MINIROOT     0x200   /* mini-root present in memory at boot time */\r
58 #define RB_CONFIG       0x400   /* invoke user configuration routing */\r
59 #define RB_VERBOSE      0x800   /* print all potentially useful info */\r
60 #define RB_SERIAL       0x1000  /* user serial port as console */\r
61 #define RB_CDROM        0x2000  /* use cdrom as root */\r
62 #define RB_POWEROFF     0x4000  /* if you can, turn the power off */\r
63 #define RB_GDB          0x8000  /* use GDB remote debugger instead of DDB */\r
64 \r
65 #define RB_BOOTINFO     0x80000000      /* have `struct bootinfo *' arg */\r
66 \r
67 /*\r
68  * Constants for converting boot-style device number to type,\r
69  * adaptor (uba, mba, etc), unit number and partition number.\r
70  * Type (== major device number) is in the low byte\r
71  * for backward compatibility.  Except for that of the "magic\r
72  * number", each mask applies to the shifted value.\r
73  * Format:\r
74  *       (4) (4) (4) (4)  (8)     (8)\r
75  *      --------------------------------\r
76  *      |MA | AD| CT| UN| PART  | TYPE |\r
77  *      --------------------------------\r
78  */\r
79 #define B_ADAPTORSHIFT          24\r
80 #define B_ADAPTORMASK           0x0f\r
81 #define B_ADAPTOR(val)          (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)\r
82 #define B_CONTROLLERSHIFT       20\r
83 #define B_CONTROLLERMASK        0xf\r
84 #define B_CONTROLLER(val)       (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)\r
85 #define B_UNITSHIFT             16\r
86 #define B_UNITMASK              0xf\r
87 #define B_UNIT(val)             (((val) >> B_UNITSHIFT) & B_UNITMASK)\r
88 #define B_PARTITIONSHIFT        8\r
89 #define B_PARTITIONMASK         0xff\r
90 #define B_PARTITION(val)        (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)\r
91 #define B_TYPESHIFT             0\r
92 #define B_TYPEMASK              0xff\r
93 #define B_TYPE(val)             (((val) >> B_TYPESHIFT) & B_TYPEMASK)\r
94 \r
95 #define B_MAGICMASK     ((u_long)0xf0000000)\r
96 #define B_DEVMAGIC      ((u_long)0xa0000000)\r
97 \r
98 #define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \\r
99         (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \\r
100         ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \\r
101         ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)\r
102 \r
103 #endif\r