diff options
author | yokota <yokota@FreeBSD.org> | 1999-09-19 08:58:53 +0000 |
---|---|---|
committer | yokota <yokota@FreeBSD.org> | 1999-09-19 08:58:53 +0000 |
commit | cd2631e4e8965f8c2fc68bdcc77143651bb8ffbe (patch) | |
tree | 94e722f104dbc677e48996bb1b7ed161aa97f5f6 /sys/dev/syscons/scmouse.c | |
parent | 385f21dad749b72b6d4126069fb4d243fb9b6fb4 (diff) | |
download | FreeBSD-src-cd2631e4e8965f8c2fc68bdcc77143651bb8ffbe.zip FreeBSD-src-cd2631e4e8965f8c2fc68bdcc77143651bb8ffbe.tar.gz |
- Hang the scr_stat struct from dev_t.
- Remove sc_get_scr_stat(). It's not necessary anymore.
- Call ttymalloc() to allocate the struct tty for each vty, rather than
statically declaring an array of struct tty. We still need a statically
allocated struct tty for the first vty which is used for the kernel
console I/O, though.
- Likewise, call ttymalloc() for /dev/sysmouse and /dev/consolectl.
- Delete unnecessary test on the pointer struct tty *tp in some functions.
- Delete unused code in scmouse.c.
WARNING: this change requires you to recompile screen savers!
Diffstat (limited to 'sys/dev/syscons/scmouse.c')
-rw-r--r-- | sys/dev/syscons/scmouse.c | 45 |
1 files changed, 11 insertions, 34 deletions
diff --git a/sys/dev/syscons/scmouse.c b/sys/dev/syscons/scmouse.c index cc5f328..1c576cd 100644 --- a/sys/dev/syscons/scmouse.c +++ b/sys/dev/syscons/scmouse.c @@ -251,27 +251,31 @@ sc_remove_cutmarking(scr_stat *scp) void sc_remove_all_cutmarkings(sc_softc_t *sc) { + scr_stat *scp; int i; /* delete cut markings in all vtys */ for (i = 0; i < sc->vtys; ++i) { - if (sc->console[i] == NULL) + scp = SC_STAT(sc->dev[i]); + if (scp == NULL) continue; - sc_remove_cutmarking(sc->console[i]); + sc_remove_cutmarking(scp); } } void sc_remove_all_mouse(sc_softc_t *sc) { + scr_stat *scp; int i; for (i = 0; i < sc->vtys; ++i) { - if (sc->console[i] == NULL) + scp = SC_STAT(sc->dev[i]); + if (scp == NULL) continue; - if (sc->console[i]->status & MOUSE_VISIBLE) { - sc->console[i]->status &= ~MOUSE_VISIBLE; - mark_all(sc->console[i]); + if (scp->status & MOUSE_VISIBLE) { + scp->status &= ~MOUSE_VISIBLE; + mark_all(scp); } } } @@ -605,7 +609,7 @@ sc_mouse_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, int i; /* scp == NULL, if tp == sc_get_mouse_tty() (/dev/sysmouse) */ - scp = sc_get_scr_stat(tp->t_dev); + scp = SC_STAT(tp->t_dev); switch (cmd) { @@ -695,21 +699,6 @@ sc_mouse_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, return EINVAL; } break; -#if 0 - if (!(scp->status & MOUSE_ENABLED)) { - scp->mouse_oldpos = scp->mouse_pos; - scp->status |= MOUSE_ENABLED; - if (!ISGRAPHSC(scp)) - scp->status |= MOUSE_VISIBLE; - splx(s); - mark_all(scp); - return 0; - } else { - splx(s); - return EINVAL; - } - break; -#endif case MOUSE_HIDE: s = spltty(); @@ -723,18 +712,6 @@ sc_mouse_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, return EINVAL; } break; -#if 0 - if (scp->status & MOUSE_ENABLED) { - scp->status &= ~(MOUSE_ENABLED | MOUSE_VISIBLE); - mark_all(scp); - splx(s); - return 0; - } else { - splx(s); - return EINVAL; - } - break; -#endif case MOUSE_MOVEABS: s = spltty(); |