BSD 4_3_Tahoe release
[unix-history] / usr / src / sys / h / reboot.h
index 1776012..b1a66e3 100644 (file)
@@ -1,9 +1,20 @@
 /*
 /*
- * Copyright (c) 1982, 1986 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
+ * All rights reserved.
  *
  *
- *     @(#)reboot.h    7.1 (Berkeley) 6/4/86
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *     @(#)reboot.h    7.5 (Berkeley) 6/27/88
  */
 
 /*
  */
 
 /*
 #define        RB_SINGLE       0x02    /* reboot to single user only */
 #define        RB_NOSYNC       0x04    /* dont sync before reboot */
 #define        RB_HALT         0x08    /* don't reboot, just halt */
 #define        RB_SINGLE       0x02    /* reboot to single user only */
 #define        RB_NOSYNC       0x04    /* dont sync before reboot */
 #define        RB_HALT         0x08    /* don't reboot, just halt */
-#define        RB_INITNAME     0x10    /* name given for /etc/init */
+#define        RB_INITNAME     0x10    /* name given for /etc/init (unused) */
 #define        RB_DFLTROOT     0x20    /* use compiled-in rootdev */
 #define        RB_DFLTROOT     0x20    /* use compiled-in rootdev */
-
-#define        RB_PANIC        0       /* reboot due to panic */
-#define        RB_BOOT         1       /* reboot due to boot() */
+#define        RB_KDB          0x40    /* give control to kernel debugger */
+#define        RB_RDONLY       0x80    /* mount root fs read-only */
+#define        RB_DUMP         0x100   /* dump kernel memory before reboot */
 
 /*
  * Constants for converting boot-style device number to type,
 
 /*
  * Constants for converting boot-style device number to type,
  * Type (== major device number) is in the low byte
  * for backward compatibility.  Except for that of the "magic
  * number", each mask applies to the shifted value.
  * Type (== major device number) is in the low byte
  * for backward compatibility.  Except for that of the "magic
  * number", each mask applies to the shifted value.
+ * Format:
+ *      (4) (4) (4) (4)  (8)     (8)
+ *     --------------------------------
+ *     |MA | AD| CT| UN| PART  | TYPE |
+ *     --------------------------------
  */
  */
-#define        B_ADAPTORSHIFT  24
-#define        B_ADAPTORMASK   0x0f
-#define B_UNITSHIFT    16
-#define B_UNITMASK     0xff
-#define B_PARTITIONSHIFT 8
-#define B_PARTITIONMASK        0xff
-#define        B_TYPESHIFT     0
-#define        B_TYPEMASK      0xff
-#define        B_MAGICMASK     0xf0000000
-#define        B_DEVMAGIC      0xa0000000
+#define        B_ADAPTORSHIFT          24
+#define        B_ADAPTORMASK           0x0f
+#define        B_ADAPTOR(val)          (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
+#define B_CONTROLLERSHIFT      20
+#define B_CONTROLLERMASK       0xf
+#define        B_CONTROLLER(val)       (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
+#define B_UNITSHIFT            16
+#define B_UNITMASK             0xf
+#define        B_UNIT(val)             (((val) >> B_UNITSHIFT) & B_UNITMASK)
+#define B_PARTITIONSHIFT       8
+#define B_PARTITIONMASK                0xff
+#define        B_PARTITION(val)        (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
+#define        B_TYPESHIFT             0
+#define        B_TYPEMASK              0xff
+#define        B_TYPE(val)             (((val) >> B_TYPESHIFT) & B_TYPEMASK)
+
+#define        B_MAGICMASK     ((u_long)0xf0000000)
+#define        B_DEVMAGIC      ((u_long)0xa0000000)
+
+#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
+       (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
+       ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
+       ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)