From 5228c2fd0a3b9f74b85119cb3908796c1c3aa5f7 Mon Sep 17 00:00:00 2001 From: briggs Date: Wed, 1 Jan 1997 15:54:21 +0000 Subject: [PATCH] Get blktochr() from sun3/sun3/conf.c --- sys/arch/mac68k/mac68k/conf.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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 -- 2.20.1