BSD 4_4 release
[unix-history] / usr / src / sys / sys / disklabel.h
index c90479c..a25ee29 100644 (file)
@@ -1,23 +1,36 @@
 /*
 /*
- * Copyright (c) 1987, 1988 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1987, 1988, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  *
- * Redistribution is only permitted until one year after the first shipment
- * of 4.4BSD by the Regents.  Otherwise, redistribution and use in source and
- * binary forms are permitted provided that: (1) source distributions retain
- * this entire copyright notice and comment, and (2) distributions including
- * binaries display the following acknowledgement:  This product includes
- * software developed by the University of California, Berkeley and its
- * contributors'' in the documentation or other materials provided with the
- * distribution and in all advertising materials mentioning features or use
- * of this software.  Neither the name of the University nor the names of
- * its contributors may 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
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
  *
  *
- *     @(#)disklabel.h 7.14 (Berkeley) 6/28/90
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)disklabel.h 8.1 (Berkeley) 6/2/93
  */
 
 /*
  */
 
 /*
  * to leave room for a bootstrap, etc.
  */
 
  * to leave room for a bootstrap, etc.
  */
 
+/* XXX these should be defined per controller (or drive) elsewhere, not here! */
+#ifdef i386
+#define LABELSECTOR    1                       /* sector containing label */
+#define LABELOFFSET    0                       /* offset of label in sector */
+#endif
+
+#ifndef        LABELSECTOR
 #define LABELSECTOR    0                       /* sector containing label */
 #define LABELSECTOR    0                       /* sector containing label */
+#endif
+
+#ifndef        LABELOFFSET
 #define LABELOFFSET    64                      /* offset of label in sector */
 #define LABELOFFSET    64                      /* offset of label in sector */
+#endif
+
 #define DISKMAGIC      ((u_long) 0x82564557)   /* The disk magic number */
 #ifndef MAXPARTITIONS
 #define        MAXPARTITIONS   8
 #define DISKMAGIC      ((u_long) 0x82564557)   /* The disk magic number */
 #ifndef MAXPARTITIONS
 #define        MAXPARTITIONS   8
@@ -131,10 +156,15 @@ struct disklabel {
                u_long  p_fsize;        /* filesystem basic fragment size */
                u_char  p_fstype;       /* filesystem type, see below */
                u_char  p_frag;         /* filesystem fragments per block */
                u_long  p_fsize;        /* filesystem basic fragment size */
                u_char  p_fstype;       /* filesystem type, see below */
                u_char  p_frag;         /* filesystem fragments per block */
-               u_short p_cpg;          /* filesystem cylinders per group */
+               union {
+                       u_short cpg;    /* UFS: FS cylinders per group */
+                       u_short sgs;    /* LFS: FS segment shift */
+               } __partition_u1;
+#define        p_cpg   __partition_u1.cpg
+#define        p_sgs   __partition_u1.sgs
        } d_partitions[MAXPARTITIONS];  /* actually may be more */
 };
        } d_partitions[MAXPARTITIONS];  /* actually may be more */
 };
-#else LOCORE
+#else /* LOCORE */
        /*
         * offsets for asm boot files.
         */
        /*
         * offsets for asm boot files.
         */
@@ -145,7 +175,7 @@ struct disklabel {
        .set    d_secpercyl,56
        .set    d_secperunit,60
        .set    d_end_,276              /* size of disk label */
        .set    d_secpercyl,56
        .set    d_secperunit,60
        .set    d_end_,276              /* size of disk label */
-#endif LOCORE
+#endif /* LOCORE */
 
 /* d_type values: */
 #define        DTYPE_SMD               1               /* SMD, XSMD; VAX hp/up */
 
 /* d_type values: */
 #define        DTYPE_SMD               1               /* SMD, XSMD; VAX hp/up */
@@ -154,6 +184,8 @@ struct disklabel {
 #define        DTYPE_SCSI              4               /* SCSI */
 #define        DTYPE_ESDI              5               /* ESDI interface */
 #define        DTYPE_ST506             6               /* ST506 etc. */
 #define        DTYPE_SCSI              4               /* SCSI */
 #define        DTYPE_ESDI              5               /* ESDI interface */
 #define        DTYPE_ST506             6               /* ST506 etc. */
+#define        DTYPE_HPIB              7               /* CS/80 on HP-IB */
+#define        DTYPE_HPFL              8               /* HP Fiber-link */
 #define        DTYPE_FLOPPY            10              /* floppy */
 
 #ifdef DKTYPENAMES
 #define        DTYPE_FLOPPY            10              /* floppy */
 
 #ifdef DKTYPENAMES
@@ -164,9 +196,9 @@ static char *dktypenames[] = {
        "old DEC",
        "SCSI",
        "ESDI",
        "old DEC",
        "SCSI",
        "ESDI",
-       "type 6",
-       "type 7",
-       "type 8",
+       "ST506",
+       "HP-IB",
+       "HP-FL",
        "type 9",
        "floppy",
        0
        "type 9",
        "floppy",
        0
@@ -187,6 +219,12 @@ static char *dktypenames[] = {
 #define        FS_V71K         5               /* V7 with 1K blocks (4.1, 2.9) */
 #define        FS_V8           6               /* Eighth Edition, 4K blocks */
 #define        FS_BSDFFS       7               /* 4.2BSD fast file system */
 #define        FS_V71K         5               /* V7 with 1K blocks (4.1, 2.9) */
 #define        FS_V8           6               /* Eighth Edition, 4K blocks */
 #define        FS_BSDFFS       7               /* 4.2BSD fast file system */
+#define        FS_MSDOS        8               /* MSDOS file system */
+#define        FS_BSDLFS       9               /* 4.4BSD log-structured file system */
+#define        FS_OTHER        10              /* in use, but unknown/unsupported */
+#define        FS_HPFS         11              /* OS/2 high-performance file system */
+#define        FS_ISO9660      12              /* ISO 9660, normally CD-ROM */
+#define        FS_BOOT         13              /* partition contains bootstrap */
 
 #ifdef DKTYPENAMES
 static char *fstypenames[] = {
 
 #ifdef DKTYPENAMES
 static char *fstypenames[] = {
@@ -198,6 +236,12 @@ static char *fstypenames[] = {
        "4.1BSD",
        "Eighth Edition",
        "4.2BSD",
        "4.1BSD",
        "Eighth Edition",
        "4.2BSD",
+       "MSDOS",
+       "4.4LFS",
+       "unknown",
+       "HPFS",
+       "ISO9660",
+       "boot",
        0
 };
 #define FSMAXTYPES     (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1)
        0
 };
 #define FSMAXTYPES     (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1)
@@ -275,12 +319,14 @@ struct partinfo {
 
 #define DIOCSBAD       _IOW('d', 110, struct dkbad)    /* set kernel dkbad */
 
 
 #define DIOCSBAD       _IOW('d', 110, struct dkbad)    /* set kernel dkbad */
 
-#endif LOCORE
+#endif /* LOCORE */
 
 #if !defined(KERNEL) && !defined(LOCORE)
 
 #if !defined(KERNEL) && !defined(LOCORE)
-#if __STDC__ || c_plusplus
-extern struct disklabel *getdiskbyname(const char *);
-#else
-extern struct disklabel *getdiskbyname();
-#endif
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+struct disklabel *getdiskbyname __P((const char *));
+__END_DECLS
+
 #endif
 #endif