1/*-
2 * Copyright (c) 1992-1998 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 11 unchanged lines hidden (view full) ---
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/dev/syscons/syscons.c 51404 1999-09-19 08:58:53Z yokota $
29 */
30
31#include "sc.h"
32#include "splash.h"
33#include "opt_syscons.h"
34#include "opt_ddb.h"
35#ifdef __i386__
36#include "apm.h"
--- 175 unchanged lines hidden (view full) ---
212static struct cdevsw sc_cdevsw = {
213 /* open */ scopen,
214 /* close */ scclose,
215 /* read */ scread,
216 /* write */ scwrite,
217 /* ioctl */ scioctl,
218 /* stop */ nostop,
219 /* reset */ noreset,
220 /* devtotty */ scdevtotty,
221 /* poll */ ttpoll,
222 /* mmap */ scmmap,
223 /* strategy */ nostrategy,
224 /* name */ "sc",
225 /* parms */ noparms,
226 /* maj */ CDEV_MAJOR,
227 /* dump */ nodump,
228 /* psize */ nopsize,
229 /* flags */ D_TTY,
--- 206 unchanged lines hidden (view full) ---
436 sc_softc_t *sc;
437
438 sc = sc_get_softc(unit, (sc_console_unit == unit) ? SC_KERNEL_CONSOLE : 0);
439 if (sc->kbd != NULL)
440 kbd_clear_state(sc->kbd);
441 return 0;
442}
443
444struct tty
445*scdevtotty(dev_t dev)
446{
447
448 return (dev->si_tty);
449}
450
451static int
452scdevtounit(dev_t dev)
453{
454 int vty = SC_VTY(dev);
455
456 if (vty == SC_CONSOLECTL)
457 return ((sc_console != NULL) ? sc_console->sc->unit : -1);
458 else if (vty == SC_MOUSE)
--- 24 unchanged lines hidden (view full) ---
483#else
484 if (sc == NULL)
485#endif
486 return ENXIO;
487
488 tp = dev->si_tty = ttymalloc(dev->si_tty);
489 tp->t_oproc = (SC_VTY(dev) == SC_MOUSE) ? scmousestart : scstart;
490 tp->t_param = scparam;
491 tp->t_dev = dev;
492 if (!(tp->t_state & TS_ISOPEN)) {
493 ttychars(tp);
494 /* Use the current setting of the <-- key as default VERASE. */
495 /* If the Delete key is preferable, an stty is necessary */
496 if (sc != NULL) {
497 key.keynum = KEYCODE_BS;
498 kbd_ioctl(sc->kbd, GIO_KEYMAPENT, (caddr_t)&key);
--- 3564 unchanged lines hidden ---
2 * Copyright (c) 1992-1998 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 11 unchanged lines hidden (view full) ---
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/dev/syscons/syscons.c 51404 1999-09-19 08:58:53Z yokota $
29 */
30
31#include "sc.h"
32#include "splash.h"
33#include "opt_syscons.h"
34#include "opt_ddb.h"
35#ifdef __i386__
36#include "apm.h"
--- 175 unchanged lines hidden (view full) ---
212static struct cdevsw sc_cdevsw = {
213 /* open */ scopen,
214 /* close */ scclose,
215 /* read */ scread,
216 /* write */ scwrite,
217 /* ioctl */ scioctl,
218 /* stop */ nostop,
219 /* reset */ noreset,
220 /* devtotty */ scdevtotty,
221 /* poll */ ttpoll,
222 /* mmap */ scmmap,
223 /* strategy */ nostrategy,
224 /* name */ "sc",
225 /* parms */ noparms,
226 /* maj */ CDEV_MAJOR,
227 /* dump */ nodump,
228 /* psize */ nopsize,
229 /* flags */ D_TTY,
--- 206 unchanged lines hidden (view full) ---
436 sc_softc_t *sc;
437
438 sc = sc_get_softc(unit, (sc_console_unit == unit) ? SC_KERNEL_CONSOLE : 0);
439 if (sc->kbd != NULL)
440 kbd_clear_state(sc->kbd);
441 return 0;
442}
443
444struct tty
445*scdevtotty(dev_t dev)
446{
447
448 return (dev->si_tty);
449}
450
451static int
452scdevtounit(dev_t dev)
453{
454 int vty = SC_VTY(dev);
455
456 if (vty == SC_CONSOLECTL)
457 return ((sc_console != NULL) ? sc_console->sc->unit : -1);
458 else if (vty == SC_MOUSE)
--- 24 unchanged lines hidden (view full) ---
483#else
484 if (sc == NULL)
485#endif
486 return ENXIO;
487
488 tp = dev->si_tty = ttymalloc(dev->si_tty);
489 tp->t_oproc = (SC_VTY(dev) == SC_MOUSE) ? scmousestart : scstart;
490 tp->t_param = scparam;
491 tp->t_dev = dev;
492 if (!(tp->t_state & TS_ISOPEN)) {
493 ttychars(tp);
494 /* Use the current setting of the <-- key as default VERASE. */
495 /* If the Delete key is preferable, an stty is necessary */
496 if (sc != NULL) {
497 key.keynum = KEYCODE_BS;
498 kbd_ioctl(sc->kbd, GIO_KEYMAPENT, (caddr_t)&key);
--- 3564 unchanged lines hidden ---