diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-11-06 01:45:19 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-11-06 01:45:19 +0000 |
commit | 9d029c6d927add68cc28d77ebddf624c20da1ca7 (patch) | |
tree | 696ce905b1b1d36eff5d1e7bfab141a97763decc | |
parent | 209267a8f5c6f17c1117de57a923ebcc1ffd189c (diff) |
add blktochr()
-rw-r--r-- | sys/arch/mvme68k/mvme68k/conf.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/arch/mvme68k/mvme68k/conf.c b/sys/arch/mvme68k/mvme68k/conf.c index 18954a24b8d..baf50c1365f 100644 --- a/sys/arch/mvme68k/mvme68k/conf.c +++ b/sys/arch/mvme68k/mvme68k/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.10 1996/10/19 13:26:09 mickey Exp $ */ +/* $OpenBSD: conf.c,v 1.11 1996/11/06 01:45:18 deraadt Exp $ */ /*- * Copyright (c) 1995 Theo de Raadt @@ -334,6 +334,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 |