diff options
author | phk <phk@FreeBSD.org> | 2005-02-27 21:52:42 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-02-27 21:52:42 +0000 |
commit | 95c6b2d151424300d9bab5ad0122d38f534ff0ae (patch) | |
tree | 1d50b1a4bd0b88055868d46e01bf09c781d30dd2 /sys | |
parent | e1a6880e8a66da7f8209922d12b2e31db0aa211e (diff) | |
download | FreeBSD-src-95c6b2d151424300d9bab5ad0122d38f534ff0ae.zip FreeBSD-src-95c6b2d151424300d9bab5ad0122d38f534ff0ae.tar.gz |
Use dynamic major number allocation for /dev/console, there is no
longer any benefit from hard wiring it.
Remove special hack used to wire major to zero despite zero having a
different magic meaning as well.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/conf/majors | 1 | ||||
-rw-r--r-- | sys/kern/kern_conf.c | 5 | ||||
-rw-r--r-- | sys/kern/tty_cons.c | 6 |
3 files changed, 1 insertions, 11 deletions
diff --git a/sys/conf/majors b/sys/conf/majors index 0f8df7f..be94f8e 100644 --- a/sys/conf/majors +++ b/sys/conf/majors @@ -19,7 +19,6 @@ # the CVS tree. # #maj name comments -0 *cn console 1 *ctty /dev/tty 2 *mm /dev/mem,kmem,etc 4 *geom GEOMetry diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index fe9339d..1344329 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -377,8 +377,7 @@ fini_cdevsw(struct cdevsw *devsw) reserved_majors[devsw->d_maj] = 0; devsw->d_maj = MAJOR_AUTO; devsw->d_flags &= ~D_ALLOCMAJ; - } else if (devsw->d_maj == 0) - devsw->d_maj = 256; + } devsw->d_flags &= ~D_INIT; } @@ -430,8 +429,6 @@ prep_cdevsw(struct cdevsw *devsw) if (devsw->d_maj == MAJOR_AUTO) { find_major(devsw); } else { - if (devsw->d_maj == 256) /* XXX: tty_cons.c is magic */ - devsw->d_maj = 0; KASSERT(devsw->d_maj >= 0 && devsw->d_maj < 256, ("Invalid major (%d) in make_dev", devsw->d_maj)); if (reserved_majors[devsw->d_maj] != devsw->d_maj) { diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c index 5fae927..abd79ba 100644 --- a/sys/kern/tty_cons.c +++ b/sys/kern/tty_cons.c @@ -69,11 +69,6 @@ static d_ioctl_t cnioctl; static d_poll_t cnpoll; static d_kqfilter_t cnkqfilter; -/* - * XXX: We really want major #0, but zero here means - * XXX: allocate a major number automatically. - * XXX: kern_conf.c knows what to do when it sees 256. - */ static struct cdevsw cn_cdevsw = { .d_version = D_VERSION, .d_open = cnopen, @@ -83,7 +78,6 @@ static struct cdevsw cn_cdevsw = { .d_ioctl = cnioctl, .d_poll = cnpoll, .d_name = "console", - .d_maj = 256, .d_flags = D_TTY | D_NEEDGIANT, .d_kqfilter = cnkqfilter, }; |