|
|
| version 1.10, 2004/05/13 23:49:17 | version 1.11, 2004/05/19 22:52:44 |
|---|---|
| Line 216 static struct cdevsw sc_cdevsw = { | Line 216 static struct cdevsw sc_cdevsw = { |
| /* poll */ ttypoll, | /* poll */ ttypoll, |
| /* mmap */ scmmap, | /* mmap */ scmmap, |
| /* strategy */ nostrategy, | /* strategy */ nostrategy, |
| /* psize */ nopsize, | |
| /* dump */ nodump, | /* dump */ nodump, |
| /* psize */ nopsize, | |
| /* kqfilter */ ttykqfilter | /* kqfilter */ ttykqfilter |
| }; | }; |
| Line 378 sc_attach_unit(int unit, int flags) | Line 378 sc_attach_unit(int unit, int flags) |
| EVENTHANDLER_REGISTER(shutdown_pre_sync, scshutdown, | EVENTHANDLER_REGISTER(shutdown_pre_sync, scshutdown, |
| (void *)(uintptr_t)unit, SHUTDOWN_PRI_DEFAULT); | (void *)(uintptr_t)unit, SHUTDOWN_PRI_DEFAULT); |
| /* | |
| * create devices. cdevsw_add() must be called to make devices under | |
| * this major number available to userland. | |
| */ | |
| cdevsw_add(&sc_cdevsw, ~(MAXCONS - 1), unit * MAXCONS); | |
| for (vc = 0; vc < sc->vtys; vc++) { | for (vc = 0; vc < sc->vtys; vc++) { |
| dev = make_dev(&sc_cdevsw, vc + unit * MAXCONS, | dev = make_dev(&sc_cdevsw, vc + unit * MAXCONS, |
| UID_ROOT, GID_WHEEL, 0600, "ttyv%r", vc + unit * MAXCONS); | UID_ROOT, GID_WHEEL, 0600, "ttyv%r", vc + unit * MAXCONS); |
| Line 389 sc_attach_unit(int unit, int flags) | Line 395 sc_attach_unit(int unit, int flags) |
| */ | */ |
| } | } |
| cdevsw_add(&sc_cdevsw, -1, SC_CONSOLECTL); /* XXX */ | |
| dev = make_dev(&sc_cdevsw, SC_CONSOLECTL, | dev = make_dev(&sc_cdevsw, SC_CONSOLECTL, |
| UID_ROOT, GID_WHEEL, 0600, "consolectl"); | UID_ROOT, GID_WHEEL, 0600, "consolectl"); |
| dev->si_tty = sc_console_tty = ttymalloc(sc_console_tty); | dev->si_tty = sc_console_tty = ttymalloc(sc_console_tty); |
| Line 1328 sccnprobe(struct consdev *cp) | Line 1335 sccnprobe(struct consdev *cp) |
| return; | return; |
| /* initialize required fields */ | /* initialize required fields */ |
| cp->cn_dev = makedev(CDEV_MAJOR, SC_CONSOLECTL); | cp->cn_dev = make_dev(&sc_cdevsw, SC_CONSOLECTL, |
| UID_ROOT, GID_WHEEL, 0600, "consolectl"); | |
| #endif /* __i386__ */ | #endif /* __i386__ */ |
| #if __alpha__ | #if __alpha__ |
| Line 1408 sccnattach(void) | Line 1416 sccnattach(void) |
| scinit(unit, flags | SC_KERNEL_CONSOLE); | scinit(unit, flags | SC_KERNEL_CONSOLE); |
| sc_console_unit = unit; | sc_console_unit = unit; |
| sc_console = SC_STAT(sc_get_softc(unit, SC_KERNEL_CONSOLE)->dev[0]); | sc_console = SC_STAT(sc_get_softc(unit, SC_KERNEL_CONSOLE)->dev[0]); |
| consdev.cn_dev = makedev(CDEV_MAJOR, 0); | consdev.cn_dev = make_dev(&sc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, |
| "ttyv%r", 0); | |
| cn_tab = &consdev; | cn_tab = &consdev; |
| } | } |
| Line 2559 scinit(int unit, int flags) | Line 2568 scinit(int unit, int flags) |
| sc->vtys = MAXCONS; /* XXX: should be configurable */ | sc->vtys = MAXCONS; /* XXX: should be configurable */ |
| if (flags & SC_KERNEL_CONSOLE) { | if (flags & SC_KERNEL_CONSOLE) { |
| sc->dev = main_devs; | sc->dev = main_devs; |
| sc->dev[0] = makedev(CDEV_MAJOR, unit*MAXCONS); | sc->dev[0] = make_dev(&sc_cdevsw, unit*MAXCONS, UID_ROOT, |
| GID_WHEEL, 0600, "ttyv%r", unit*MAXCONS); | |
| sc->dev[0]->si_tty = &main_tty; | sc->dev[0]->si_tty = &main_tty; |
| ttyregister(&main_tty); | ttyregister(&main_tty); |
| scp = &main_console; | scp = &main_console; |
| Line 2575 scinit(int unit, int flags) | Line 2585 scinit(int unit, int flags) |
| /* assert(sc_malloc) */ | /* assert(sc_malloc) */ |
| sc->dev = malloc(sizeof(dev_t)*sc->vtys, M_DEVBUF, M_WAITOK); | sc->dev = malloc(sizeof(dev_t)*sc->vtys, M_DEVBUF, M_WAITOK); |
| bzero(sc->dev, sizeof(dev_t)*sc->vtys); | bzero(sc->dev, sizeof(dev_t)*sc->vtys); |
| sc->dev[0] = makedev(CDEV_MAJOR, unit*MAXCONS); | sc->dev[0] = make_dev(&sc_cdevsw, unit*MAXCONS, UID_ROOT, |
| GID_WHEEL, 0600, "ttyv%r", unit*MAXCONS); | |
| sc->dev[0]->si_tty = ttymalloc(sc->dev[0]->si_tty); | sc->dev[0]->si_tty = ttymalloc(sc->dev[0]->si_tty); |
| scp = alloc_scp(sc, sc->first_vty); | scp = alloc_scp(sc, sc->first_vty); |
| } | } |