Back to index

glibc  2.9
reboot.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1982, 1986, 1988, 1993
00003  *     The Regents of the University of California.  All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  * 4. Neither the name of the University nor the names of its contributors
00014  *    may be used to endorse or promote products derived from this software
00015  *    without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00027  * SUCH DAMAGE.
00028  *
00029  *     @(#)reboot.h  8.1 (Berkeley) 6/2/93
00030  */
00031 
00032 /*
00033  * Arguments to reboot system call.
00034  * These are passed to boot program in r11,
00035  * and on to init.
00036  */
00037 #define       RB_AUTOBOOT   0      /* flags for system auto-booting itself */
00038 
00039 #define       RB_ASKNAME    0x01   /* ask for file name to reboot from */
00040 #define       RB_SINGLE     0x02   /* reboot to single user only */
00041 #define       RB_NOSYNC     0x04   /* don't sync before reboot */
00042 #define       RB_HALT              0x08   /* don't reboot, just halt */
00043 #define       RB_INITNAME   0x10   /* name given for /etc/init (unused) */
00044 #define       RB_DFLTROOT   0x20   /* use compiled-in rootdev */
00045 #define       RB_KDB        0x40   /* give control to kernel debugger */
00046 #define       RB_RDONLY     0x80   /* mount root fs read-only */
00047 #define       RB_DUMP              0x100  /* dump kernel memory before reboot */
00048 #define       RB_MINIROOT   0x200  /* mini-root present in memory at boot time */
00049 
00050 /*
00051  * Constants for converting boot-style device number to type,
00052  * adaptor (uba, mba, etc), unit number and partition number.
00053  * Type (== major device number) is in the low byte
00054  * for backward compatibility.  Except for that of the "magic
00055  * number", each mask applies to the shifted value.
00056  * Format:
00057  *      (4) (4) (4) (4)  (8)     (8)
00058  *     --------------------------------
00059  *     |MA | AD| CT| UN| PART  | TYPE |
00060  *     --------------------------------
00061  */
00062 #define       B_ADAPTORSHIFT              24
00063 #define       B_ADAPTORMASK        0x0f
00064 #define       B_ADAPTOR(val)              (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
00065 #define B_CONTROLLERSHIFT   20
00066 #define B_CONTROLLERMASK    0xf
00067 #define       B_CONTROLLER(val)    (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
00068 #define B_UNITSHIFT         16
00069 #define B_UNITMASK          0xf
00070 #define       B_UNIT(val)          (((val) >> B_UNITSHIFT) & B_UNITMASK)
00071 #define B_PARTITIONSHIFT    8
00072 #define B_PARTITIONMASK            0xff
00073 #define       B_PARTITION(val)     (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
00074 #define       B_TYPESHIFT          0
00075 #define       B_TYPEMASK           0xff
00076 #define       B_TYPE(val)          (((val) >> B_TYPESHIFT) & B_TYPEMASK)
00077 
00078 #define       B_MAGICMASK   ((u_long)0xf0000000)
00079 #define       B_DEVMAGIC    ((u_long)0xa0000000)
00080 
00081 #define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
00082        (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
00083        ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
00084        ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)