Back to index

glibc  2.9
reboot.h
Go to the documentation of this file.
00001 /*
00002  * Mach Operating System
00003  * Copyright (C) 1993,1991,1990 Carnegie Mellon University
00004  * All Rights Reserved.
00005  *
00006  * Permission to use, copy, modify and distribute this software and its
00007  * documentation is hereby granted, provided that both the copyright
00008  * notice and this permission notice appear in all copies of the
00009  * software, derivative works or modified versions, and any portions
00010  * thereof, and that both notices appear in supporting documentation.
00011  *
00012  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
00013  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
00014  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
00015  *
00016  * Carnegie Mellon requests users of this software to return to
00017  *
00018  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
00019  *  School of Computer Science
00020  *  Carnegie Mellon University
00021  *  Pittsburgh PA 15213-3890
00022  *
00023  * any improvements or extensions that they make and grant Carnegie Mellon
00024  * the rights to redistribute these changes.
00025  */
00026 /*
00027  * (pre-GNU) HISTORY
00028  *
00029  * Revision 2.8  93/03/11  13:46:40  danner
00030  *     u_long -> u_int.
00031  *     [93/03/09            danner]
00032  *
00033  * Revision 2.7  92/05/21  17:25:11  jfriedl
00034  *     Appended 'U' to constants that would otherwise be signed.
00035  *     [92/05/16            jfriedl]
00036  *
00037  * Revision 2.6  91/06/19  11:59:44  rvb
00038  *     Second byte of boothowto is flags for "startup" program.
00039  *     [91/06/18            rvb]
00040  *     Add ifndef __ASSEMBLER__ so that vax_init.s can include it.
00041  *     [91/06/11            rvb]
00042  *
00043  * Revision 2.5  91/05/14  17:40:11  mrt
00044  *     Correcting copyright
00045  *
00046  * Revision 2.4  91/02/05  17:56:48  mrt
00047  *     Changed to new Mach copyright
00048  *     [91/02/01  17:49:12  mrt]
00049  *
00050  * Revision 2.3  90/08/27  22:12:56  dbg
00051  *     Added definitions used by Mach Kernel: RB_DEBUGGER, RB_UNIPROC,
00052  *     RB_NOBOOTRC, RB_ALTBOOT.  Moved RB_KDB to 0x04 (Mach value).
00053  *     Removed RB_RDONLY, RB_DUMP, RB_NOSYNC.
00054  *     [90/08/14            dbg]
00055  *
00056  */
00057 
00058 /*
00059    Copyright (C) 1982, 1986, 1988 Regents of the University of California.
00060    All rights reserved.
00061 
00062    Redistribution and use in source and binary forms, with or without
00063    modification, are permitted provided that the following conditions
00064    are met:
00065 
00066    1. Redistributions of source code must retain the above copyright
00067       notice, this list of conditions and the following disclaimer.
00068    2. Redistributions in binary form must reproduce the above copyright
00069       notice, this list of conditions and the following disclaimer in the
00070       documentation and/or other materials provided with the distribution.
00071    4. Neither the name of the University nor the names of its contributors
00072       may be used to endorse or promote products derived from this software
00073       without specific prior written permission.
00074 
00075    THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00076    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00077    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00078    ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00079    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00080    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00081    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00082    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00083    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00084    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00085    SUCH DAMAGE.*/
00086 
00087 /*
00088  *     @(#)reboot.h  7.5 (Berkeley) 6/27/88
00089  */
00090 
00091 #ifndef       _SYS_REBOOT_H_
00092 #define       _SYS_REBOOT_H_
00093 
00094 #include <features.h>
00095 
00096 /*
00097  * Arguments to reboot system call.
00098  * These are converted to switches, and passed to startup program,
00099  * and on to init.
00100  */
00101 #define       RB_AUTOBOOT   0      /* flags for system auto-booting itself */
00102 
00103 #define       RB_ASKNAME    0x01   /* -a: ask for file name to reboot from */
00104 #define       RB_SINGLE     0x02   /* -s: reboot to single user only */
00105 #define       RB_KDB        0x04   /* -d: kernel debugger symbols loaded */
00106 #define       RB_HALT              0x08   /* -h: enter KDB at bootup */
00107                             /*     for host_reboot(): don't reboot,
00108                                    just halt */
00109 #define       RB_INITNAME   0x10   /* -i: name given for /etc/init (unused) */
00110 #define       RB_DFLTROOT   0x20   /*     use compiled-in rootdev */
00111 #define       RB_NOBOOTRC   0x20   /* -b: don't run /etc/rc.boot */
00112 #define RB_ALTBOOT   0x40   /*     use /boot.old vs /boot */
00113 #define       RB_UNIPROC    0x80   /* -u: start only one processor */
00114 
00115 #define       RB_SHIFT      8      /* second byte is for ux */
00116 
00117 #define       RB_DEBUGGER   0x1000 /*     for host_reboot(): enter kernel
00118                                    debugger from user level */
00119 
00120 /*
00121  * Constants for converting boot-style device number to type,
00122  * adaptor (uba, mba, etc), unit number and partition number.
00123  * Type (== major device number) is in the low byte
00124  * for backward compatibility.  Except for that of the "magic
00125  * number", each mask applies to the shifted value.
00126  * Format:
00127  *      (4) (4) (4) (4)  (8)     (8)
00128  *     --------------------------------
00129  *     |MA | AD| CT| UN| PART  | TYPE |
00130  *     --------------------------------
00131  */
00132 #define       B_ADAPTORSHIFT              24
00133 #define       B_ADAPTORMASK        0x0f
00134 #define       B_ADAPTOR(val)              (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
00135 #define B_CONTROLLERSHIFT   20
00136 #define B_CONTROLLERMASK    0xf
00137 #define       B_CONTROLLER(val)    (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
00138 #define B_UNITSHIFT         16
00139 #define B_UNITMASK          0xf
00140 #define       B_UNIT(val)          (((val) >> B_UNITSHIFT) & B_UNITMASK)
00141 #define B_PARTITIONSHIFT    8
00142 #define B_PARTITIONMASK            0xff
00143 #define       B_PARTITION(val)     (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
00144 #define       B_TYPESHIFT          0
00145 #define       B_TYPEMASK           0xff
00146 #define       B_TYPE(val)          (((val) >> B_TYPESHIFT) & B_TYPEMASK)
00147 
00148 #define       B_MAGICMASK   ((u_int)0xf0000000U)
00149 #define       B_DEVMAGIC    ((u_int)0xa0000000U)
00150 
00151 #define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
00152        (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
00153        ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
00154        ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
00155 
00156 
00157 #ifdef KERNEL
00158 #ifndef       __ASSEMBLER__
00159 extern int boothowto;
00160 #endif /* __ASSEMBLER__ */
00161 #endif
00162 
00163 __BEGIN_DECLS
00164 
00165 /* Reboot or halt the system.  */
00166 extern int reboot (int __howto) __THROW;
00167 
00168 __END_DECLS
00169 
00170 
00171 #endif /* _SYS_REBOOT_H_ */