summaryrefslogtreecommitdiff
path: root/sys/arch/arc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-11-06 01:38:27 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-11-06 01:38:27 +0000
commit9730d99a05f8dd8a4a4d8b11fbe51152e280a94e (patch)
treeb625150e7c43b456cd14a793a41141d1467169ee /sys/arch/arc
parentbfc1a9157e29e88ca9f274ac98c7a0ace04f4ac5 (diff)
add blktochr
Diffstat (limited to 'sys/arch/arc')
-rw-r--r--sys/arch/arc/arc/conf.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/sys/arch/arc/arc/conf.c b/sys/arch/arc/arc/conf.c
index ee86389526f..ee4aac85f3b 100644
--- a/sys/arch/arc/arc/conf.c
+++ b/sys/arch/arc/arc/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.7 1996/10/19 13:26:04 mickey Exp $ */
+/* $OpenBSD: conf.c,v 1.8 1996/11/06 01:38:26 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)conf.c 8.2 (Berkeley) 11/14/93
- * $Id: conf.c,v 1.7 1996/10/19 13:26:04 mickey Exp $
+ * $Id: conf.c,v 1.8 1996/11/06 01:38:26 deraadt Exp $
*/
#include <sys/param.h>
@@ -320,6 +320,24 @@ chrtoblk(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(chrtoblktbl)/sizeof(chrtoblktbl[0]); i++)
+ if (blkmaj == chrtoblktbl[i])
+ return (makedev(i, minor(dev)));
+ return (NODEV);
+}
+
+/*
* This entire table could be autoconfig()ed but that would mean that
* the kernel's idea of the console would be out of sync with that of
* the standalone boot. I think it best that they both use the same