summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorbriggs <briggs@cvs.openbsd.org>1997-01-01 15:54:22 +0000
committerbriggs <briggs@cvs.openbsd.org>1997-01-01 15:54:22 +0000
commit02f51811531313ea061573e065d56e2301d652f7 (patch)
tree496ab475253c172e411645829c6e34a3395f6107 /sys
parentfcfa4407b9d7fbd581cf9a41154b661f7c92d797 (diff)
Get blktochr() from sun3/sun3/conf.c
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mac68k/mac68k/conf.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/arch/mac68k/mac68k/conf.c b/sys/arch/mac68k/mac68k/conf.c
index 765445fa964..ea33b3de4aa 100644
--- a/sys/arch/mac68k/mac68k/conf.c
+++ b/sys/arch/mac68k/mac68k/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.12 1996/11/11 22:55:57 kstailey Exp $ */
+/* $OpenBSD: conf.c,v 1.13 1997/01/01 15:54:21 briggs Exp $ */
/* $NetBSD: conf.c,v 1.34 1996/06/19 02:20:54 briggs Exp $ */
/*
@@ -250,6 +250,24 @@ chrtoblk(dev)
return (makedev(blkmaj, minor(dev)));
}
+/*
+ * Convert a character device number to a block device number.
+ */
+dev_t
+blktochr(dev)
+ dev_t dev;
+{
+ int blkmaj = major(dev);
+ int i;
+
+ if (blkmaj >= nblkdev)
+ return (NODEV);
+ for (i = 0; i < sizeof(chrtoblktab)/sizeof(chrtoblktab[0]); i++)
+ if (blkmaj == chrtoblktab[i])
+ return (makedev(i, minor(dev)));
+ return (NODEV);
+}
+
#define itecnpollc nullcnpollc
cons_decl(ite);
#define zscnpollc nullcnpollc