home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / glibc-1.09 / glibc-1 / glibc-1.09.1 / sysdeps / mach / sys / reboot.h
Encoding:
C/C++ Source or Header  |  1994-07-18  |  5.3 KB  |  151 lines

  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  Software.Distribution@CS.CMU.EDU
  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.  * HISTORY
  28.  * $Log: reboot.h,v $
  29.  * Revision 1.1  1993/08/03  22:25:15  roland
  30.  * entered into RCS
  31.  *
  32.  * Revision 2.8  93/03/11  13:46:40  danner
  33.  *     u_long -> u_int.
  34.  *     [93/03/09            danner]
  35.  * 
  36.  * Revision 2.7  92/05/21  17:25:11  jfriedl
  37.  *     Appended 'U' to constants that would otherwise be signed.
  38.  *     [92/05/16            jfriedl]
  39.  * 
  40.  * Revision 2.6  91/06/19  11:59:44  rvb
  41.  *     Second byte of boothowto is flags for "startup" program.
  42.  *     [91/06/18            rvb]
  43.  *     Add ifndef ASSEMBLER so that vax_init.s can include it.
  44.  *     [91/06/11            rvb]
  45.  * 
  46.  * Revision 2.5  91/05/14  17:40:11  mrt
  47.  *     Correcting copyright
  48.  * 
  49.  * Revision 2.4  91/02/05  17:56:48  mrt
  50.  *     Changed to new Mach copyright
  51.  *     [91/02/01  17:49:12  mrt]
  52.  * 
  53.  * Revision 2.3  90/08/27  22:12:56  dbg
  54.  *     Added definitions used by Mach Kernel: RB_DEBUGGER, RB_UNIPROC,
  55.  *     RB_NOBOOTRC, RB_ALTBOOT.  Moved RB_KDB to 0x04 (Mach value).
  56.  *     Removed RB_RDONLY, RB_DUMP, RB_NOSYNC.
  57.  *     [90/08/14            dbg]
  58.  * 
  59.  */
  60.  
  61. /*
  62.  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
  63.  * All rights reserved.
  64.  *
  65.  * Redistribution and use in source and binary forms are permitted
  66.  * provided that the above copyright notice and this paragraph are
  67.  * duplicated in all such forms and that any documentation,
  68.  * advertising materials, and other materials related to such
  69.  * distribution and use acknowledge that the software was developed
  70.  * by the University of California, Berkeley.  The name of the
  71.  * University may not be used to endorse or promote products derived
  72.  * from this software without specific prior written permission.
  73.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  74.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  75.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  76.  *
  77.  *    @(#)reboot.h    7.5 (Berkeley) 6/27/88
  78.  */
  79.  
  80. #ifndef    _SYS_REBOOT_H_
  81. #define    _SYS_REBOOT_H_
  82.  
  83. /*
  84.  * Arguments to reboot system call.
  85.  * These are converted to switches, and passed to startup program,
  86.  * and on to init.
  87.  */
  88. #define    RB_AUTOBOOT    0    /* flags for system auto-booting itself */
  89.  
  90. #define    RB_ASKNAME    0x01    /* -a: ask for file name to reboot from */
  91. #define    RB_SINGLE    0x02    /* -s: reboot to single user only */
  92. #define    RB_KDB        0x04    /* -d: kernel debugger symbols loaded */
  93. #define    RB_HALT        0x08    /* -h: enter KDB at bootup */
  94.                 /*     for host_reboot(): don't reboot,
  95.                        just halt */
  96. #define    RB_INITNAME    0x10    /* -i: name given for /etc/init (unused) */
  97. #define    RB_DFLTROOT    0x20    /*     use compiled-in rootdev */
  98. #define    RB_NOBOOTRC    0x20    /* -b: don't run /etc/rc.boot */
  99. #define RB_ALTBOOT    0x40    /*     use /boot.old vs /boot */
  100. #define    RB_UNIPROC    0x80    /* -u: start only one processor */
  101.  
  102. #define    RB_SHIFT    8    /* second byte is for ux */
  103.  
  104. #define    RB_DEBUGGER    0x1000    /*     for host_reboot(): enter kernel
  105.                        debugger from user level */
  106.  
  107. /*
  108.  * Constants for converting boot-style device number to type,
  109.  * adaptor (uba, mba, etc), unit number and partition number.
  110.  * Type (== major device number) is in the low byte
  111.  * for backward compatibility.  Except for that of the "magic
  112.  * number", each mask applies to the shifted value.
  113.  * Format:
  114.  *     (4) (4) (4) (4)  (8)     (8)
  115.  *    --------------------------------
  116.  *    |MA | AD| CT| UN| PART  | TYPE |
  117.  *    --------------------------------
  118.  */
  119. #define    B_ADAPTORSHIFT        24
  120. #define    B_ADAPTORMASK        0x0f
  121. #define    B_ADAPTOR(val)        (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
  122. #define B_CONTROLLERSHIFT    20
  123. #define B_CONTROLLERMASK    0xf
  124. #define    B_CONTROLLER(val)    (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
  125. #define B_UNITSHIFT        16
  126. #define B_UNITMASK        0xf
  127. #define    B_UNIT(val)        (((val) >> B_UNITSHIFT) & B_UNITMASK)
  128. #define B_PARTITIONSHIFT    8
  129. #define B_PARTITIONMASK        0xff
  130. #define    B_PARTITION(val)    (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
  131. #define    B_TYPESHIFT        0
  132. #define    B_TYPEMASK        0xff
  133. #define    B_TYPE(val)        (((val) >> B_TYPESHIFT) & B_TYPEMASK)
  134.  
  135. #define    B_MAGICMASK    ((u_int)0xf0000000U)
  136. #define    B_DEVMAGIC    ((u_int)0xa0000000U)
  137.  
  138. #define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
  139.     (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
  140.     ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
  141.     ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
  142.  
  143.  
  144. #ifdef    KERNEL
  145. #ifndef    ASSEMBLER
  146. extern int boothowto;
  147. #endif    ASSEMBLER
  148. #endif
  149.  
  150. #endif    /* _SYS_REBOOT_H_ */
  151.