From 5fca9172ef23c5aaa95f17e432e082cad284925b Mon Sep 17 00:00:00 2001 From: downsj Date: Mon, 10 Feb 1997 01:33:55 +0000 Subject: [PATCH] Support 16 partitions. --- etc/etc.hp300/MAKEDEV | 52 +++++++++++++++++++----------- sys/arch/hp300/conf/files.hp300 | 4 +-- sys/arch/hp300/dev/hdvar.h | 9 +++--- sys/arch/hp300/dev/sd.c | 8 ++--- sys/arch/hp300/dev/sdvar.h | 9 +++--- sys/arch/hp300/include/disklabel.h | 9 ++++-- 6 files changed, 55 insertions(+), 36 deletions(-) diff --git a/etc/etc.hp300/MAKEDEV b/etc/etc.hp300/MAKEDEV index 3c9847de221..9fdb35f87af 100644 --- a/etc/etc.hp300/MAKEDEV +++ b/etc/etc.hp300/MAKEDEV @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: MAKEDEV,v 1.12 1997/02/03 07:02:08 downsj Exp $ +# $OpenBSD: MAKEDEV,v 1.13 1997/02/10 01:34:08 downsj Exp $ # $NetBSD: MAKEDEV,v 1.12 1995/11/05 23:50:22 thorpej Exp $ # # Copyright (c) 1990 The Regents of the University of California. @@ -165,7 +165,7 @@ tun*) chown root.wheel tun$unit ;; -ccd*|fd*|hd*|sd*|vnd*) +ccd*|hd*|sd*|vnd*) umask 2 ; unit=`expr $i : '.*d\(.*\)'` case $i in hd*) name=hd; blk=2; chr=9;; @@ -177,22 +177,38 @@ ccd*|fd*|hd*|sd*|vnd*) 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|\ 17|18|19|20|21|22|23|24|25|26|27|28|29|30|31) rm -f $name$unit? r$name$unit? - mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` - mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1` - mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` - mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3` - mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4` - mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5` - mknod ${name}${unit}g b $blk `expr $unit '*' 8 + 6` - mknod ${name}${unit}h b $blk `expr $unit '*' 8 + 7` - mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` - mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1` - mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` - mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3` - mknod r${name}${unit}e c $chr `expr $unit '*' 8 + 4` - mknod r${name}${unit}f c $chr `expr $unit '*' 8 + 5` - mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6` - mknod r${name}${unit}h c $chr `expr $unit '*' 8 + 7` + mknod ${name}${unit}a b $blk `expr $unit '*' 16 + 0` + mknod ${name}${unit}b b $blk `expr $unit '*' 16 + 1` + mknod ${name}${unit}c b $blk `expr $unit '*' 16 + 2` + mknod ${name}${unit}d b $blk `expr $unit '*' 16 + 3` + mknod ${name}${unit}e b $blk `expr $unit '*' 16 + 4` + mknod ${name}${unit}f b $blk `expr $unit '*' 16 + 5` + mknod ${name}${unit}g b $blk `expr $unit '*' 16 + 6` + mknod ${name}${unit}h b $blk `expr $unit '*' 16 + 7` + mknod ${name}${unit}i b $blk `expr $unit '*' 16 + 8` + mknod ${name}${unit}j b $blk `expr $unit '*' 16 + 9` + mknod ${name}${unit}k b $blk `expr $unit '*' 16 + 10` + mknod ${name}${unit}l b $blk `expr $unit '*' 16 + 11` + mknod ${name}${unit}m b $blk `expr $unit '*' 16 + 12` + mknod ${name}${unit}n b $blk `expr $unit '*' 16 + 13` + mknod ${name}${unit}o b $blk `expr $unit '*' 16 + 14` + mknod ${name}${unit}p b $blk `expr $unit '*' 16 + 15` + mknod r${name}${unit}a c $chr `expr $unit '*' 16 + 0` + mknod r${name}${unit}b c $chr `expr $unit '*' 16 + 1` + mknod r${name}${unit}c c $chr `expr $unit '*' 16 + 2` + mknod r${name}${unit}d c $chr `expr $unit '*' 16 + 3` + mknod r${name}${unit}e c $chr `expr $unit '*' 16 + 4` + mknod r${name}${unit}f c $chr `expr $unit '*' 16 + 5` + mknod r${name}${unit}g c $chr `expr $unit '*' 16 + 6` + mknod r${name}${unit}h c $chr `expr $unit '*' 16 + 7` + mknod r${name}${unit}i c $chr `expr $unit '*' 16 + 8` + mknod r${name}${unit}j c $chr `expr $unit '*' 16 + 9` + mknod r${name}${unit}k c $chr `expr $unit '*' 16 + 10` + mknod r${name}${unit}l c $chr `expr $unit '*' 16 + 11` + mknod r${name}${unit}m c $chr `expr $unit '*' 16 + 12` + mknod r${name}${unit}n c $chr `expr $unit '*' 16 + 13` + mknod r${name}${unit}o c $chr `expr $unit '*' 16 + 14` + mknod r${name}${unit}p c $chr `expr $unit '*' 16 + 15` chown root.operator ${name}${unit}[a-h] r${name}${unit}[a-h] chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h] ;; diff --git a/sys/arch/hp300/conf/files.hp300 b/sys/arch/hp300/conf/files.hp300 index 70618b0bc25..be7031a0d0f 100644 --- a/sys/arch/hp300/conf/files.hp300 +++ b/sys/arch/hp300/conf/files.hp300 @@ -1,10 +1,10 @@ -# $OpenBSD: files.hp300,v 1.3 1997/02/03 08:11:52 downsj Exp $ +# $OpenBSD: files.hp300,v 1.4 1997/02/10 01:33:55 downsj Exp $ # $NetBSD: files.hp300,v 1.22 1997/01/30 22:11:19 scottr Exp $ # # hp300-specific configuration info # maxpartitions must be the first item in files.${ARCH} -maxpartitions 8 +maxpartitions 16 maxusers 2 8 64 diff --git a/sys/arch/hp300/dev/hdvar.h b/sys/arch/hp300/dev/hdvar.h index 051bdb246a5..85a71d05cfa 100644 --- a/sys/arch/hp300/dev/hdvar.h +++ b/sys/arch/hp300/dev/hdvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hdvar.h,v 1.1 1997/02/03 08:11:55 downsj Exp $ */ +/* $OpenBSD: hdvar.h,v 1.2 1997/02/10 01:33:56 downsj Exp $ */ /* $NetBSD: rdvar.h,v 1.6 1997/01/30 09:14:19 thorpej Exp $ */ /* @@ -91,10 +91,9 @@ struct hd_softc { #define HDF_WANTED 0x20 #define HDF_WLABEL 0x40 -#define hdunit(x) (minor(x) >> 3) -#define hdpart(x) (minor(x) & 0x7) -#define hdpunit(x) ((x) & 7) -#define hdlabdev(d) (dev_t)(((int)(d)&~7)|2) /* hd?c */ +#define hdunit(x) DISKUNIT(x) +#define hdpart(x) DISKPART(x) +#define hdlabdev(d) MAKEDISKDEV(major(d), hdunit(d), RAW_PART) #define b_cylin b_resid diff --git a/sys/arch/hp300/dev/sd.c b/sys/arch/hp300/dev/sd.c index ecc87b4d639..d848472cfd2 100644 --- a/sys/arch/hp300/dev/sd.c +++ b/sys/arch/hp300/dev/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.7 1997/02/03 04:47:47 downsj Exp $ */ +/* $OpenBSD: sd.c,v 1.8 1997/02/10 01:33:57 downsj Exp $ */ /* $NetBSD: sd.c,v 1.29 1997/01/30 09:14:20 thorpej Exp $ */ /* @@ -1022,9 +1022,6 @@ sdioctl(dev, cmd, data, flag, p) int error, flags; switch (cmd) { - default: - return (EINVAL); - case DIOCGDINFO: *(struct disklabel *)data = *lp; return (0); @@ -1106,6 +1103,9 @@ sdioctl(dev, cmd, data, flag, p) */ bcopy(&sc->sc_sensestore, data, sizeof(sc->sc_sensestore)); return (0); + + default: + return (EINVAL); } /*NOTREACHED*/ diff --git a/sys/arch/hp300/dev/sdvar.h b/sys/arch/hp300/dev/sdvar.h index c3d9921798c..a23d9dccc6b 100644 --- a/sys/arch/hp300/dev/sdvar.h +++ b/sys/arch/hp300/dev/sdvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sdvar.h,v 1.6 1997/02/03 04:47:48 downsj Exp $ */ +/* $OpenBSD: sdvar.h,v 1.7 1997/02/10 01:33:58 downsj Exp $ */ /* $NetBSD: sdvar.h,v 1.6 1997/01/30 09:14:22 thorpej Exp $ */ /* @@ -74,10 +74,9 @@ struct sd_softc { #define SDF_RMEDIA 0x20 #define SDF_ERROR 0x40 -#define sdunit(x) (minor(x) >> 3) -#define sdpart(x) (minor(x) & 0x7) -#define sdpunit(x) ((x) & 7) -#define sdlabdev(d) (dev_t)(((int)(d)&~7)|2) /* sd?c */ +#define sdunit(x) DISKUNIT(x) +#define sdpart(x) DISKPART(x) +#define sdlabdev(d) MAKEDISKDEV(major(d), sdunit(d), RAW_PART) #define b_cylin b_resid diff --git a/sys/arch/hp300/include/disklabel.h b/sys/arch/hp300/include/disklabel.h index 883ac3b1005..98c0a7ce943 100644 --- a/sys/arch/hp300/include/disklabel.h +++ b/sys/arch/hp300/include/disklabel.h @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.h,v 1.2 1997/01/12 15:13:34 downsj Exp $ */ +/* $OpenBSD: disklabel.h,v 1.3 1997/02/10 01:33:58 downsj Exp $ */ /* $NetBSD: disklabel.h,v 1.1 1994/10/14 18:26:39 cgd Exp $ */ /* @@ -36,7 +36,7 @@ #define LABELSECTOR (1024 / DEV_BSIZE) /* sector containing label */ #define LABELOFFSET 0 /* offset of label in sector */ -#define MAXPARTITIONS 8 /* number of partitions */ +#define MAXPARTITIONS 16 /* number of partitions */ #define RAW_PART 2 /* raw partition: xx?c */ /* Just a dummy */ @@ -44,4 +44,9 @@ struct cpu_disklabel { int cd_dummy; /* must have one element. */ }; +#ifdef _KERNEL +struct disklabel; +int bounds_check_with_label __P((struct buf *, struct disklabel *, int)); +#endif + #endif /* _MACHINE_DISKLABEL_H_ */ -- 2.20.1