summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc/include/disklabel.h
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1997-10-13 10:53:50 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1997-10-13 10:53:50 +0000
commitef834a87737378e1dc26e0e3e32e5d1445167855 (patch)
tree6d0361ba13d27d2dc1e4f8dac57eebd57defdded /sys/arch/powerpc/include/disklabel.h
parent3741f00a6b332fa2e185b942e237df76267d52b8 (diff)
Monolithic PowerPC kernel, new include
Diffstat (limited to 'sys/arch/powerpc/include/disklabel.h')
-rw-r--r--sys/arch/powerpc/include/disklabel.h94
1 files changed, 48 insertions, 46 deletions
diff --git a/sys/arch/powerpc/include/disklabel.h b/sys/arch/powerpc/include/disklabel.h
index 77357753562..12fc143328a 100644
--- a/sys/arch/powerpc/include/disklabel.h
+++ b/sys/arch/powerpc/include/disklabel.h
@@ -1,9 +1,7 @@
-/* $OpenBSD: disklabel.h,v 1.5 1997/09/29 18:55:13 deraadt Exp $ */
-/* $NetBSD: disklabel.h,v 1.1 1996/09/30 16:34:22 ws Exp $ */
+/* $OpenBSD: disklabel.h,v 1.6 1997/10/13 10:53:42 pefo Exp $ */
-/*-
- * Copyright (C) 1995, 1996 Wolfgang Solfrank.
- * Copyright (C) 1995, 1996 TooLs GmbH.
+/*
+ * Copyright (c) 1994 Christopher G. Demetriou
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -16,29 +14,29 @@
* 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 TooLs GmbH.
- * 4. The name of TooLs GmbH may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * This product includes software developed by Christopher G. Demetriou.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
*
- * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 TOOLS GMBH 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.
+ * IN NO EVENT SHALL THE AUTHOR 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.
*/
-#ifndef _MACHINE_DISKLABEL_H_
-#define _MACHINE_DISKLABEL_H_
+#ifndef _MACHINE_DISKLABEL_H_
+#define _MACHINE_DISKLABEL_H_
#define LABELSECTOR 1 /* sector containing label */
#define LABELOFFSET 0 /* offset of label in sector */
#define MAXPARTITIONS 16 /* number of partitions */
-#define RAW_PART 2 /* raw partition: XX?c */
+#define RAW_PART 2 /* raw partition: ie. rsd0c */
/* MBR partition table */
#define MBRSECTOR 0 /* MBR sector number */
@@ -61,39 +59,43 @@ struct mbr_partition {
unsigned long mbr_size; /* partition size in sectors */
};
-/* Known partition types: */
-#define MBR_EXTENDED 0x05 /* Extended partition */
-#define MBR_NETBSD_LE 0xa5 /* NetBSD little endian partition */
-#define MBR_NETBSD_BE 0xa6 /* NetBSD big endian partition */
-#define MBR_NETBSD MBR_NETBSD_BE /* on this machine, we default to BE */
-
-/* For compatibility reasons (mainly for fdisk): */
-#define dos_partition mbr_partition
-#define dp_flag mbr_flag
-#define dp_shd mbr_shd
-#define dp_ssect mbr_ssect
-#define dp_scyl mbr_scyl
-#define dp_typ mbr_type
-#define dp_ehd mbr_ehd
-#define dp_esect mbr_esect
-#define dp_ecyl mbr_ecyl
-#define dp_start mbr_start
-#define dp_size mbr_size
-
-#define DOSPARTOFF MBRPARTOFF
-#define NDOSPART NMBRPART
-
+/* Known DOS partition types. */
+#define DOSPTYP_UNUSED 0x00 /* Unused partition */
+#define DOSPTYP_FAT12 0x01 /* 12-bit FAT */
+#define DOSPTYP_FAT16S 0x04 /* 16-bit FAT, less than 32M */
#define DOSPTYP_EXTEND 0x05 /* Extended; contains sub-partitions */
-#define DOSPTYP_386BSD MBR_NETBSD
-#define DOSPTYP_OPENBSD 0xa6 /* OpenBSD partition type */
-#define DOSACTIVE 0x80
+#define DOSPTYP_FAT16B 0x06 /* 16-bit FAT, more than 32M */
+#define DOSPTYP_FAT16C 0x0e /* 16-bit FAT, CHS-mapped */
+#define DOSPTYP_ONTRACK 0x54
+#define DOSPTYP_LINUX 0x83 /* That other thing */
+#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */
+#define DOSPTYP_NETBSD DOSPTYP_386BSD /* NetBSD partition type (XXX) */
+#define DOSPTYP_OPENBSD 0xa6 /* OpenBSD partition type */
+#include <sys/dkbad.h>
struct cpu_disklabel {
- int cd_start; /* Offset to NetBSD partition in blocks */
+ struct dos_partition dosparts[NDOSPART];
+ struct dkbad bad;
};
+#define DKBAD(x) ((x)->bad)
+
/* Isolate the relevant bits to get sector and cylinder. */
#define DPSECT(s) ((s) & 0x3f)
#define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2))
-#endif /* _MACHINE_DISKLABEL_H_ */
+static __inline u_int32_t
+get_le(p)
+ void *p;
+{
+ u_int32_t c;
+ u_int8_t *_p = (u_int8_t *)p;
+ int x;
+ x = _p[0];
+ x |= _p[1] << 8;
+ x |= _p[2] << 16;
+ x |= _p[3] << 24;
+ return x;
+}
+
+#endif /* _MACHINE_DISKLABEL_H_ */