summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_conf.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-07-17 19:57:25 +0000
committerphk <phk@FreeBSD.org>1999-07-17 19:57:25 +0000
commitc23426c8742b675de1d3fe6164d6fc4a73f6c1b4 (patch)
tree9edd248dbddf635442b8a0e52ef1ffff40d4ebae /sys/kern/kern_conf.c
parentfb0144f561662735ee009149b579e3bb512e0c09 (diff)
downloadFreeBSD-src-c23426c8742b675de1d3fe6164d6fc4a73f6c1b4.zip
FreeBSD-src-c23426c8742b675de1d3fe6164d6fc4a73f6c1b4.tar.gz
Use 256 as magic in bmaj2cmaj[]. Treat BLK/CHR dev_t more correctly.
Diffstat (limited to 'sys/kern/kern_conf.c')
-rw-r--r--sys/kern/kern_conf.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 1123404..99ad6a6 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_conf.c,v 1.47 1999/07/04 14:58:38 phk Exp $
+ * $Id: kern_conf.c,v 1.48 1999/07/17 18:43:45 phk Exp $
*/
#include <sys/param.h>
@@ -57,7 +57,7 @@ chrtoblk(dev_t dev)
if((cd = devsw(dev)) != NULL) {
if (cd->d_bmaj != -1)
- return(makedev(cd->d_bmaj,minor(dev)));
+ return(makebdev(cd->d_bmaj,minor(dev)));
}
return(NODEV);
}
@@ -74,7 +74,7 @@ bdevsw(dev_t dev)
struct cdevsw *c;
int i = major(dev);
- if (bmaj2cmaj[i] == 254)
+ if (bmaj2cmaj[i] == 256)
return 0;
c = cdevsw[bmaj2cmaj[major(dev)]];
@@ -102,7 +102,7 @@ cdevsw_add(struct cdevsw *newentry)
if (!setup) {
for (i = 0; i < NUMCDEVSW; i++)
if (!bmaj2cmaj[i])
- bmaj2cmaj[i] = 254;
+ bmaj2cmaj[i] = 256;
setup++;
}
@@ -119,7 +119,7 @@ cdevsw_add(struct cdevsw *newentry)
cdevsw[newentry->d_maj] = newentry;
if (newentry->d_bmaj >= 0 && newentry->d_bmaj < NUMCDEVSW) {
- if (bmaj2cmaj[newentry->d_bmaj] != 254) {
+ if (bmaj2cmaj[newentry->d_bmaj] != 256) {
printf("WARNING: \"%s\" is usurping \"%s\"'s bmaj\n",
newentry->d_name,
cdevsw[bmaj2cmaj[newentry->d_bmaj]]->d_name);
@@ -231,7 +231,15 @@ dev2udev(dev_t x)
dev_t
udev2dev(udev_t x, int b)
{
- return makedev(umajor(x), uminor(x));
+ switch (b) {
+ case 0:
+ return makedev(umajor(x), uminor(x));
+ case 1:
+ return makebdev(umajor(x), uminor(x));
+ default:
+ Debugger("udev2dev(...,X)");
+ return NODEV;
+ }
}
int
OpenPOWER on IntegriCloud