mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-12 09:58:36 +00:00
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.
This commit is contained in:
parent
bde229cc2c
commit
89685e2269
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142702
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user