summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2006-06-26 23:11:32 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2006-06-26 23:11:32 +0000
commita1d7cd01feeb95baf8b01d04ac65c3a898effa1e (patch)
tree3befb7a5fe40c753ec4e30c05439c51e91bf8e8c /sys/arch
parent9e9988f19afd848e2f55a63d7b7611b6cb7c706f (diff)
Clean up some inconsistancies in definitions around DOS MBR code. No
functional change. ok deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/include/disklabel.h4
-rw-r--r--sys/arch/arm/include/disklabel.h13
-rw-r--r--sys/arch/aviion/include/disklabel.h11
-rw-r--r--sys/arch/hppa/include/disklabel.h3
-rw-r--r--sys/arch/hppa64/include/disklabel.h3
-rw-r--r--sys/arch/macppc/include/disklabel.h28
-rw-r--r--sys/arch/macppc/macppc/disksubr.c4
-rw-r--r--sys/arch/mips64/include/disklabel.h3
-rw-r--r--sys/arch/mvmeppc/include/disklabel.h28
-rw-r--r--sys/arch/mvmeppc/mvmeppc/disksubr.c4
10 files changed, 51 insertions, 50 deletions
diff --git a/sys/arch/amd64/include/disklabel.h b/sys/arch/amd64/include/disklabel.h
index bf6b91950b0..d312d90b226 100644
--- a/sys/arch/amd64/include/disklabel.h
+++ b/sys/arch/amd64/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.2 2004/11/10 10:36:12 grange Exp $ */
+/* $OpenBSD: disklabel.h,v 1.3 2006/06/26 23:11:31 krw Exp $ */
/* $NetBSD: disklabel.h,v 1.3 1996/03/09 20:52:54 ghudson Exp $ */
/*
@@ -79,7 +79,7 @@ struct dos_mbr {
u_int8_t dmbr_boot[DOSPARTOFF];
struct dos_partition dmbr_parts[NDOSPART];
u_int16_t dmbr_sign;
-} __attribute__((__packed__));
+} __packed;
#define DOSMBR_SIGNATURE (0xaa55)
#define DOSMBR_SIGNATURE_OFF (0x1fe)
diff --git a/sys/arch/arm/include/disklabel.h b/sys/arch/arm/include/disklabel.h
index c3e5078bc4b..d21c578ba61 100644
--- a/sys/arch/arm/include/disklabel.h
+++ b/sys/arch/arm/include/disklabel.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: disklabel.h,v 1.5 2005/11/04 13:33:59 uwe Exp $ */
-/* $OpenBSD: disklabel.h,v 1.5 2005/11/04 13:33:59 uwe Exp $ */
+/* $OpenBSD: disklabel.h,v 1.6 2006/06/26 23:11:31 krw Exp $ */
+/* $OpenBSD: disklabel.h,v 1.6 2006/06/26 23:11:31 krw Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2001/11/25 19:02:03 thorpej Exp $ */
/*
@@ -92,7 +92,7 @@ struct dos_partition {
#define DOSPTYP_FAT16B 0x06 /* 16-bit FAT, more than 32M */
#define DOSPTYP_FAT32 0x0b /* 32-bit FAT */
#define DOSPTYP_FAT32L 0x0c /* 32-bit FAT, LBA-mapped */
-#define DOSPTYP_FAT16C 0x0e /* 16-bit FAT, CHS-mapped */
+#define DOSPTYP_FAT16L 0x0e /* 16-bit FAT, LBA-mapped */
#define DOSPTYP_EXTENDL 0x0f /* Extended, LBA-mapped; contains sub-partitions */
#define DOSPTYP_ONTRACK 0x54
#define DOSPTYP_LINUX 0x83 /* That other thing */
@@ -108,12 +108,12 @@ struct dos_partition {
#ifdef __ARMEL__
#define get_le(x) (*((u_int32_t *)x))
#else
-static __inline u_int32_t get_le(void *p);
+static __inline u_int32_t get_le(void *);
static __inline u_int32_t
get_le(void *p)
{
u_int8_t *_p = (u_int8_t *)p;
- int x;
+ u_int32_t x;
x = _p[0];
x |= _p[1] << 8;
x |= _p[2] << 16;
@@ -123,9 +123,8 @@ get_le(void *p)
#endif
-#define NMBRPART 4
struct cpu_disklabel {
- struct dos_partition dosparts[NMBRPART];
+ struct dos_partition dosparts[NDOSPART];
struct dkbad bad;
};
diff --git a/sys/arch/aviion/include/disklabel.h b/sys/arch/aviion/include/disklabel.h
index 215d60b465f..46a012aee4c 100644
--- a/sys/arch/aviion/include/disklabel.h
+++ b/sys/arch/aviion/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.1 2006/05/09 18:32:42 miod Exp $ */
+/* $OpenBSD: disklabel.h,v 1.2 2006/06/26 23:11:31 krw Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2001/11/25 19:02:03 thorpej Exp $ */
/*
@@ -87,7 +87,7 @@ struct dos_partition {
#define DOSPTYP_FAT16B 0x06 /* 16-bit FAT, more than 32M */
#define DOSPTYP_FAT32 0x0b /* 32-bit FAT */
#define DOSPTYP_FAT32L 0x0c /* 32-bit FAT, LBA-mapped */
-#define DOSPTYP_FAT16C 0x0e /* 16-bit FAT, CHS-mapped */
+#define DOSPTYP_FAT16L 0x0e /* 16-bit FAT, LBA-mapped */
#define DOSPTYP_EXTENDL 0x0f /* Extended, LBA-mapped; contains sub-partitions */
#define DOSPTYP_ONTRACK 0x54
#define DOSPTYP_LINUX 0x83 /* That other thing */
@@ -98,12 +98,12 @@ struct dos_partition {
#define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2))
-static __inline u_int32_t get_le(void *p);
+static __inline u_int32_t get_le(void *);
static __inline u_int32_t
get_le(void *p)
{
u_int8_t *_p = (u_int8_t *)p;
- int x;
+ u_int32_t x;
x = _p[0];
x |= _p[1] << 8;
x |= _p[2] << 16;
@@ -111,9 +111,8 @@ get_le(void *p)
return x;
}
-#define NMBRPART 4
struct cpu_disklabel {
- struct dos_partition dosparts[NMBRPART];
+ struct dos_partition dosparts[NDOSPART];
struct dkbad bad;
};
diff --git a/sys/arch/hppa/include/disklabel.h b/sys/arch/hppa/include/disklabel.h
index af3a0663746..e73efe8b578 100644
--- a/sys/arch/hppa/include/disklabel.h
+++ b/sys/arch/hppa/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.9 2006/06/19 01:52:19 krw Exp $ */
+/* $OpenBSD: disklabel.h,v 1.10 2006/06/26 23:11:31 krw Exp $ */
/* $NetBSD: disklabel.h,v 1.1 1995/02/13 23:07:34 cgd Exp $ */
/*
@@ -86,6 +86,7 @@ struct dos_partition {
#define DOSPTYP_FAT32 0x0b /* 32-bit FAT */
#define DOSPTYP_FAT32L 0x0c /* 32-bit FAT, LBA-mapped */
#define DOSPTYP_FAT16L 0x0e /* 16-bit FAT, LBA-mapped */
+#define DOSPTYP_EXTENDL 0x0f /* Extended, LBA-mapped; contains sub-partitions */
#define DOSPTYP_ONTRACK 0x54
#define DOSPTYP_LINUX 0x83 /* That other thing */
#define DOSPTYP_FREEBSD 0xa5 /* FreeBSD partition type */
diff --git a/sys/arch/hppa64/include/disklabel.h b/sys/arch/hppa64/include/disklabel.h
index 06cbb1594f2..5e99a86c884 100644
--- a/sys/arch/hppa64/include/disklabel.h
+++ b/sys/arch/hppa64/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.3 2006/06/19 01:52:19 krw Exp $ */
+/* $OpenBSD: disklabel.h,v 1.4 2006/06/26 23:11:31 krw Exp $ */
/* $NetBSD: disklabel.h,v 1.1 1995/02/13 23:07:34 cgd Exp $ */
/*
@@ -86,6 +86,7 @@ struct dos_partition {
#define DOSPTYP_FAT32 0x0b /* 32-bit FAT */
#define DOSPTYP_FAT32L 0x0c /* 32-bit FAT, LBA-mapped */
#define DOSPTYP_FAT16L 0x0e /* 16-bit FAT, LBA-mapped */
+#define DOSPTYP_EXTENDL 0x0f /* Extended, LBA-mapped; contains sub-partitions */
#define DOSPTYP_ONTRACK 0x54
#define DOSPTYP_LINUX 0x83 /* That other thing */
#define DOSPTYP_FREEBSD 0xa5 /* FreeBSD partition type */
diff --git a/sys/arch/macppc/include/disklabel.h b/sys/arch/macppc/include/disklabel.h
index ee78f75fc52..07ae6dc615b 100644
--- a/sys/arch/macppc/include/disklabel.h
+++ b/sys/arch/macppc/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.5 2004/11/10 10:36:12 grange Exp $ */
+/* $OpenBSD: disklabel.h,v 1.6 2006/06/26 23:11:31 krw Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -50,16 +50,16 @@
#define DOSACTIVE 0x80
struct dos_partition {
- unsigned char dp_flag; /* default boot flag */
- unsigned char dp_shd; /* start head, IsN't Always Meaningful */
- unsigned char dp_ssect; /* start sector, INAM */
- unsigned char dp_scyl; /* start cylinder, INAM */
- unsigned char dp_typ; /* partition type */
- unsigned char dp_ehd; /* end head, INAM */
- unsigned char dp_esect; /* end sector, INAM */
- unsigned char dp_ecyl; /* end cylinder, INAM */
- unsigned long dp_start; /* absolute start sector number */
- unsigned long dp_size; /* partition size in sectors */
+ u_int8_t dp_flag; /* default boot flag */
+ u_int8_t dp_shd; /* start head, IsN't Always Meaningful */
+ u_int8_t dp_ssect; /* start sector, INAM */
+ u_int8_t dp_scyl; /* start cylinder, INAM */
+ u_int8_t dp_typ; /* partition type */
+ u_int8_t dp_ehd; /* end head, INAM */
+ u_int8_t dp_esect; /* end sector, INAM */
+ u_int8_t dp_ecyl; /* end cylinder, INAM */
+ u_int32_t dp_start; /* absolute start sector number */
+ u_int32_t dp_size; /* partition size in sectors */
};
/* Known DOS partition types. */
@@ -70,7 +70,7 @@ struct dos_partition {
#define DOSPTYP_FAT16B 0x06 /* 16-bit FAT, more than 32M */
#define DOSPTYP_FAT32 0x0b /* 32-bit FAT */
#define DOSPTYP_FAT32L 0x0c /* 32-bit FAT, LBA-mapped */
-#define DOSPTYP_FAT16C 0x0e /* 16-bit FAT, CHS-mapped */
+#define DOSPTYP_FAT16L 0x0e /* 16-bit FAT, LBA-mapped */
#define DOSPTYP_EXTENDL 0x0f /* Extended, LBA-mapped; contains sub-partitions */
#define DOSPTYP_ONTRACK 0x54
#define DOSPTYP_LINUX 0x83 /* That other thing */
@@ -84,13 +84,13 @@ struct dos_partition {
#define DPSECT(s) ((s) & 0x3f)
#define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2))
-static __inline u_int32_t get_le(void *p);
+static __inline u_int32_t get_le(void *);
static __inline u_int32_t
get_le(void *p)
{
u_int8_t *_p = (u_int8_t *)p;
- int x;
+ u_int32_t x;
x = _p[0];
x |= _p[1] << 8;
x |= _p[2] << 16;
diff --git a/sys/arch/macppc/macppc/disksubr.c b/sys/arch/macppc/macppc/disksubr.c
index 4f625285aa8..9b564f34062 100644
--- a/sys/arch/macppc/macppc/disksubr.c
+++ b/sys/arch/macppc/macppc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.16 2006/03/15 20:20:40 miod Exp $ */
+/* $OpenBSD: disksubr.c,v 1.17 2006/06/26 23:11:31 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -294,7 +294,7 @@ donot:
case DOSPTYP_FAT12:
case DOSPTYP_FAT16S:
case DOSPTYP_FAT16B:
- case DOSPTYP_FAT16C:
+ case DOSPTYP_FAT16L:
case DOSPTYP_FAT32:
pp->p_fstype = FS_MSDOS;
n++;
diff --git a/sys/arch/mips64/include/disklabel.h b/sys/arch/mips64/include/disklabel.h
index 57e190e0b27..4ff7b4708f5 100644
--- a/sys/arch/mips64/include/disklabel.h
+++ b/sys/arch/mips64/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.5 2006/06/19 01:52:19 krw Exp $ */
+/* $OpenBSD: disklabel.h,v 1.6 2006/06/26 23:11:31 krw Exp $ */
/* $NetBSD: disklabel.h,v 1.1 1995/02/13 23:07:34 cgd Exp $ */
/*
@@ -88,6 +88,7 @@ struct dos_partition {
#define DOSPTYP_FAT32 0x0b /* 32-bit FAT */
#define DOSPTYP_FAT32L 0x0c /* 32-bit FAT, LBA-mapped */
#define DOSPTYP_FAT16L 0x0e /* 16-bit FAT, LBA-mapped */
+#define DOSPTYP_EXTENDL 0x0f /* Extended, LBA-mapped; contains sub-partitions */
#define DOSPTYP_ONTRACK 0x54
#define DOSPTYP_LINUX 0x83 /* That other thing */
#define DOSPTYP_FREEBSD 0xa5 /* FreeBSD partition type */
diff --git a/sys/arch/mvmeppc/include/disklabel.h b/sys/arch/mvmeppc/include/disklabel.h
index 5a848e1ca17..4b4632835a8 100644
--- a/sys/arch/mvmeppc/include/disklabel.h
+++ b/sys/arch/mvmeppc/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.4 2004/11/10 10:36:12 grange Exp $ */
+/* $OpenBSD: disklabel.h,v 1.5 2006/06/26 23:11:31 krw Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -50,16 +50,16 @@
#define DOSACTIVE 0x80
struct dos_partition {
- unsigned char dp_flag; /* default boot flag */
- unsigned char dp_shd; /* start head, IsN't Always Meaningful */
- unsigned char dp_ssect; /* start sector, INAM */
- unsigned char dp_scyl; /* start cylinder, INAM */
- unsigned char dp_typ; /* partition type */
- unsigned char dp_ehd; /* end head, INAM */
- unsigned char dp_esect; /* end sector, INAM */
- unsigned char dp_ecyl; /* end cylinder, INAM */
- unsigned long dp_start; /* absolute start sector number */
- unsigned long dp_size; /* partition size in sectors */
+ u_int8_t dp_flag; /* default boot flag */
+ u_int8_t dp_shd; /* start head, IsN't Always Meaningful */
+ u_int8_t dp_ssect; /* start sector, INAM */
+ u_int8_t dp_scyl; /* start cylinder, INAM */
+ u_int8_t dp_typ; /* partition type */
+ u_int8_t dp_ehd; /* end head, INAM */
+ u_int8_t dp_esect; /* end sector, INAM */
+ u_int8_t dp_ecyl; /* end cylinder, INAM */
+ u_int32_t dp_start; /* absolute start sector number */
+ u_int32_t dp_size; /* partition size in sectors */
};
/* Known DOS partition types. */
@@ -70,7 +70,7 @@ struct dos_partition {
#define DOSPTYP_FAT16B 0x06 /* 16-bit FAT, more than 32M */
#define DOSPTYP_FAT32 0x0b /* 32-bit FAT */
#define DOSPTYP_FAT32L 0x0c /* 32-bit FAT, LBA-mapped */
-#define DOSPTYP_FAT16C 0x0e /* 16-bit FAT, CHS-mapped */
+#define DOSPTYP_FAT16L 0x0e /* 16-bit FAT, LBA-mapped */
#define DOSPTYP_EXTENDL 0x0f /* Extended, LBA-mapped; contains sub-partitions */
#define DOSPTYP_ONTRACK 0x54
#define DOSPTYP_LINUX 0x83 /* That other thing */
@@ -90,13 +90,13 @@ struct cpu_disklabel {
#define DPSECT(s) ((s) & 0x3f)
#define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2))
-static __inline u_int32_t get_le(void *p);
+static __inline u_int32_t get_le(void *);
static __inline u_int32_t
get_le(void *p)
{
u_int8_t *_p = (u_int8_t *)p;
- int x;
+ u_int32_t x;
x = _p[0];
x |= _p[1] << 8;
x |= _p[2] << 16;
diff --git a/sys/arch/mvmeppc/mvmeppc/disksubr.c b/sys/arch/mvmeppc/mvmeppc/disksubr.c
index 91238d9c4a3..51e0b90dfc2 100644
--- a/sys/arch/mvmeppc/mvmeppc/disksubr.c
+++ b/sys/arch/mvmeppc/mvmeppc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.12 2006/03/15 20:20:40 miod Exp $ */
+/* $OpenBSD: disksubr.c,v 1.13 2006/06/26 23:11:31 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -210,7 +210,7 @@ donot:
case DOSPTYP_FAT12:
case DOSPTYP_FAT16S:
case DOSPTYP_FAT16B:
- case DOSPTYP_FAT16C:
+ case DOSPTYP_FAT16L:
case DOSPTYP_FAT32:
pp->p_fstype = FS_MSDOS;
n++;