summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-02 18:28:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-02 18:28:49 +0000
commit392abcd849ee8dc4e7592565cef52d12c428cc3c (patch)
treeb3ade5696717a4de69615d42e3bee9733216b657 /sys/arch
parente13c85fa6f83a03bfdd249509731dd8d5194baea (diff)
use FDPART(), limit drives to 2 to avoid dev_t problems; grr@shandakor.tharsis.com
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/dev/fd.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c
index fb77075a5c5..0d3c957ac54 100644
--- a/sys/arch/sparc/dev/fd.c
+++ b/sys/arch/sparc/dev/fd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fd.c,v 1.14 1997/04/02 01:33:15 deraadt Exp $ */
+/* $OpenBSD: fd.c,v 1.15 1997/04/02 18:28:48 deraadt Exp $ */
/* $NetBSD: fd.c,v 1.33.4.1 1996/06/12 20:52:25 pk Exp $ */
/*-
@@ -68,7 +68,7 @@
#include <sparc/dev/fdreg.h>
#include <sparc/dev/fdvar.h>
-#define FDUNIT(dev) ((dev & 0x180) >> 7)
+#define FDUNIT(dev) ((dev & 0x80) >> 7)
#define FDTYPE(dev) ((minor(dev) & 0x70) >> 4)
#define FDPART(dev) (minor(dev) & 0x0f)
@@ -468,10 +468,13 @@ fdcattach(parent, self, aux)
}
- /* physical limit: four drives per controller. */
- for (fa.fa_drive = 0; fa.fa_drive < 4; fa.fa_drive++) {
+ /*
+ * physical limit: four drives per controller, but the dev_t
+ * only has room for 2
+ */
+ for (fa.fa_drive = 0; fa.fa_drive < 2; fa.fa_drive++) {
fa.fa_deftype = NULL; /* unknown */
- fa.fa_deftype = &fd_types[0]; /* XXX */
+ fa.fa_deftype = &fd_types[0]; /* XXX */
(void)config_found(self, (void *)&fa, fdprint);
}
@@ -877,7 +880,7 @@ fdopen(dev, flags, fmt, p)
if (fd->sc_dk.dk_openmask == 0)
fdgetdisklabel(dev);
- pmask = (1 << DISKPART(dev));
+ pmask = (1 << FDPART(dev));
switch (fmt) {
case S_IFCHR:
@@ -901,7 +904,7 @@ fdclose(dev, flags, fmt, p)
struct proc *p;
{
struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];
- int pmask = (1 << DISKPART(dev));
+ int pmask = (1 << FDPART(dev));
fd->sc_flags &= ~FD_OPEN;