Use dynamic major number allocation.

This commit is contained in:
Poul-Henning Kamp 2005-02-27 22:02:03 +00:00
parent 3f8bb25bd0
commit acd102e64b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142709
4 changed files with 3 additions and 14 deletions

View File

@ -21,8 +21,6 @@
#maj name comments
1 *ctty /dev/tty
4 *geom GEOMetry
5 *pts pseudo tty "tty" half
6 *ptc pseudo tty "master" half
19 *tw X-10 power interface
22 *fd (/dev/stdin etc)
30 *snd sound driver system

View File

@ -63,7 +63,6 @@ static d_poll_t logpoll;
static void logtimeout(void *arg);
#define CDEV_MAJOR 7
static struct cdevsw log_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
@ -73,7 +72,6 @@ static struct cdevsw log_cdevsw = {
.d_ioctl = logioctl,
.d_poll = logpoll,
.d_name = "log",
.d_maj = CDEV_MAJOR,
};
static struct logsoftc {
@ -252,4 +250,4 @@ log_drvinit(void *unused)
make_dev(&log_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "klog");
}
SYSINIT(logdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,log_drvinit,NULL)
SYSINIT(logdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,log_drvinit,NULL)

View File

@ -77,7 +77,6 @@ static d_ioctl_t ptcioctl;
static d_write_t ptcwrite;
static d_poll_t ptcpoll;
#define CDEV_MAJOR_S 5
static struct cdevsw pts_cdevsw = {
.d_version = D_VERSION,
.d_open = ptsopen,
@ -86,11 +85,9 @@ static struct cdevsw pts_cdevsw = {
.d_write = ptswrite,
.d_ioctl = ptsioctl,
.d_name = "pts",
.d_maj = CDEV_MAJOR_S,
.d_flags = D_TTY | D_NEEDGIANT,
};
#define CDEV_MAJOR_C 6
static struct cdevsw ptc_cdevsw = {
.d_version = D_VERSION,
.d_open = ptcopen,
@ -100,7 +97,6 @@ static struct cdevsw ptc_cdevsw = {
.d_ioctl = ptcioctl,
.d_poll = ptcpoll,
.d_name = "ptc",
.d_maj = CDEV_MAJOR_C,
.d_flags = D_TTY | D_NEEDGIANT,
};
@ -725,4 +721,4 @@ ptc_drvinit(void *unused)
EVENTHANDLER_REGISTER(dev_clone, pty_clone, 0, 1000);
}
SYSINIT(ptcdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR_C,ptc_drvinit,NULL)
SYSINIT(ptcdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,ptc_drvinit,NULL)

View File

@ -35,13 +35,10 @@ __FBSDID("$FreeBSD$");
static d_open_t cttyopen;
#define CDEV_MAJOR 1
static struct cdevsw ctty_cdevsw = {
.d_version = D_VERSION,
.d_open = cttyopen,
.d_name = "ctty",
.d_maj = CDEV_MAJOR,
.d_flags = D_TTY | D_NEEDGIANT,
};
@ -78,4 +75,4 @@ ctty_drvinit(void *unused)
ctty = make_dev(&ctty_cdevsw, 0, 0, 0, 0666, "ctty");
}
SYSINIT(cttydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,ctty_drvinit,NULL)
SYSINIT(cttydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,ctty_drvinit,NULL)