summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-09-25 16:21:39 +0000
committerphk <phk@FreeBSD.org>1999-09-25 16:21:39 +0000
commita2c68c62dba7acc1de5dd6a6141484d9c12844fe (patch)
treec55829a482e5222c5ae63cf589d4fd2a7ec13aec /sys/kern/tty.c
parent869afb6bbe2f0a063d91bf2099b7121d2d03c1b2 (diff)
downloadFreeBSD-src-a2c68c62dba7acc1de5dd6a6141484d9c12844fe.zip
FreeBSD-src-a2c68c62dba7acc1de5dd6a6141484d9c12844fe.tar.gz
This patch clears the way for removing a number of tty related
fields in struct cdevsw: d_stop moved to struct tty. d_reset already unused. d_devtotty linkage now provided by dev_t->si_tty. These fields will be removed from struct cdevsw together with d_params and d_maxio Real Soon Now. The changes in this patch consist of: initialize dev->si_tty in *_open() initialize tty->t_stop remove devtotty functions rename ttpoll to ttypoll a few adjustments to these changes in the generic code a bump of __FreeBSD_version add a couple of FreeBSD tags
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index ee1b6e7..88456be 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -422,12 +422,7 @@ parmrk:
if (CCEQ(cc[VSTOP], c)) {
if (!ISSET(tp->t_state, TS_TTSTOP)) {
SET(tp->t_state, TS_TTSTOP);
-#ifdef sun4c /* XXX */
(*tp->t_stop)(tp, 0);
-#else
- (*devsw(tp->t_dev)->d_stop)(tp,
- 0);
-#endif
return (0);
}
if (!CCEQ(cc[VSTART], c))
@@ -999,11 +994,7 @@ ttioctl(tp, cmd, data, flag)
s = spltty();
if (!ISSET(tp->t_state, TS_TTSTOP)) {
SET(tp->t_state, TS_TTSTOP);
-#ifdef sun4c /* XXX */
(*tp->t_stop)(tp, 0);
-#else
- (*devsw(tp->t_dev)->d_stop)(tp, 0);
-#endif
}
splx(s);
break;
@@ -1062,14 +1053,16 @@ ttioctl(tp, cmd, data, flag)
}
int
-ttypoll(tp, events, p)
- struct tty *tp;
+ttypoll(dev, events, p)
+ dev_t dev;
int events;
struct proc *p;
{
int s;
int revents = 0;
+ struct tty *tp;
+ tp = dev->si_tty;
if (tp == NULL) /* XXX used to return ENXIO, but that means true! */
return ((events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM))
| POLLHUP);
@@ -1094,19 +1087,6 @@ ttypoll(tp, events, p)
}
/*
- * This is a wrapper for compatibility with the select vector used by
- * cdevsw. It relies on a proper xxxdevtotty routine.
- */
-int
-ttpoll(dev, events, p)
- dev_t dev;
- int events;
- struct proc *p;
-{
- return ttypoll((*devsw(dev)->d_devtotty)(dev), events, p);
-}
-
-/*
* Must be called at spltty().
*/
static int
@@ -1192,11 +1172,7 @@ again:
FLUSHQ(&tp->t_outq);
CLR(tp->t_state, TS_TTSTOP);
}
-#ifdef sun4c /* XXX */
(*tp->t_stop)(tp, rw);
-#else
- (*devsw(tp->t_dev)->d_stop)(tp, rw);
-#endif
if (rw & FREAD) {
FLUSHQ(&tp->t_canq);
FLUSHQ(&tp->t_rawq);
@@ -1377,11 +1353,7 @@ ttymodem(tp, flag)
} else if (!ISSET(tp->t_state, TS_CAR_OFLOW)) {
SET(tp->t_state, TS_CAR_OFLOW);
SET(tp->t_state, TS_TTSTOP);
-#ifdef sun4c /* XXX */
(*tp->t_stop)(tp, 0);
-#else
- (*devsw(tp->t_dev)->d_stop)(tp, 0);
-#endif
}
} else if (flag == 0) {
/*
OpenPOWER on IntegriCloud