diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2004-06-26 09:20:07 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2004-06-26 09:20:07 +0000 |
commit | cb9ea5f4cbd32931cd4444df5024abfd9d66194b (patch) | |
tree | c93b5edd593fd013f81731c196b7d1369e3d5f78 /sys/dev | |
parent | 57ceda5d843396c1ad98cf7e979fa2a3f2825620 (diff) | |
download | src-cb9ea5f4cbd32931cd4444df5024abfd9d66194b.tar.gz src-cb9ea5f4cbd32931cd4444df5024abfd9d66194b.zip |
Pick the hotchar out of the tty structure instead of caching private
copies.
No current line disciplines have a dynamically changing hotchar, and
expecting to receive anything sensible during a change in ldisc is
insane so no locking of the hotchar field is necessary.
Notes
Notes:
svn path=/head/; revision=131134
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/cy/cy.c | 25 | ||||
-rw-r--r-- | sys/dev/rc/rc.c | 13 | ||||
-rw-r--r-- | sys/dev/si/si.c | 4 | ||||
-rw-r--r-- | sys/dev/si/si.h | 1 | ||||
-rw-r--r-- | sys/dev/sio/sio.c | 11 | ||||
-rw-r--r-- | sys/dev/sx/sx.c | 4 | ||||
-rw-r--r-- | sys/dev/sx/sx.h | 1 | ||||
-rw-r--r-- | sys/dev/usb/ucom.c | 13 | ||||
-rw-r--r-- | sys/dev/usb/ucomvar.h | 1 |
9 files changed, 31 insertions, 42 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c index 53caa3edb661..3a1d26ed3dc8 100644 --- a/sys/dev/cy/cy.c +++ b/sys/dev/cy/cy.c @@ -271,7 +271,6 @@ struct com_s { u_char last_modem_status; /* last MSR read by intr handler */ u_char prev_modem_status; /* last MSR handled by high level */ - u_char hotchar; /* ldisc-specific char to be handled ASAP */ u_char *ibuf; /* start of input buffer */ u_char *ibufend; /* end of input buffer */ u_char *ibufold; /* old input buffer, to be freed */ @@ -1111,7 +1110,7 @@ siointr1(vcom) recv_data = cd_inb(iobase, CD1400_RDSR, cy_align); #ifndef SOFT_HOTCHAR if (line_status & CD1400_RDSR_SPECIAL - && com->hotchar != 0) + && com->tp->t_hotchar != 0) swi_sched(sio_fast_ih, 0); #endif @@ -1139,7 +1138,7 @@ siointr1(vcom) #endif /* 1 */ ++com->bytes_in; #ifdef SOFT_HOTCHAR - if (com->hotchar != 0 && recv_data == com->hotchar) + if (com->tp->t_hotchar != 0 && recv_data == com->tp->t_hotchar) swi_sched(sio_fast_ih, 0); #endif ioptr = com->iptr; @@ -1187,9 +1186,9 @@ siointr1(vcom) CD1400_RDSR, cy_align); #ifdef SOFT_HOTCHAR - if (com->hotchar != 0 + if (com->tp->t_hotchar != 0 && recv_data - == com->hotchar) + == com->tp->t_hotchar) swi_sched(sio_fast_ih, 0); #endif @@ -1204,8 +1203,8 @@ siointr1(vcom) recv_data = cd_inb(iobase, CD1400_RDSR, cy_align); #ifdef SOFT_HOTCHAR - if (com->hotchar != 0 - && recv_data == com->hotchar) + if (com->tp->t_hotchar != 0 + && recv_data == com->tp->t_hotchar) swi_sched(sio_fast_ih, 0); #endif } while (--count != 0); @@ -1229,8 +1228,8 @@ siointr1(vcom) recv_data = cd_inb(iobase, CD1400_RDSR, cy_align); #ifdef SOFT_HOTCHAR - if (com->hotchar != 0 - && recv_data == com->hotchar) + if (com->tp->t_hotchar != 0 + && recv_data == com->tp->t_hotchar) swi_sched(sio_fast_ih, 0); #endif ioptr[0] = recv_data; @@ -2578,12 +2577,12 @@ disc_optim(tp, t, com) u_char opt; #endif - com->hotchar = ttyldoptim(tp); + ttyldoptim(tp); #ifndef SOFT_HOTCHAR opt = com->cor[2] & ~CD1400_COR3_SCD34; - if (com->hotchar != 0) { - cd_setreg(com, CD1400_SCHR3, com->hotchar); - cd_setreg(com, CD1400_SCHR4, com->hotchar); + if (com->tp->t_hotchar != 0) { + cd_setreg(com, CD1400_SCHR3, com->tp->t_hotchar); + cd_setreg(com, CD1400_SCHR4, com->tp->t_hotchar); opt |= CD1400_COR3_SCD34; } if (opt != com->cor[2]) { diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c index de80e92a01e0..18bb09e8616f 100644 --- a/sys/dev/rc/rc.c +++ b/sys/dev/rc/rc.c @@ -95,7 +95,6 @@ struct rc_chans { u_char rc_pendcmd; /* special cmd pending */ u_int rc_dtrwait; /* dtr timeout */ u_int rc_dcdwaits; /* how many waits DCD in open */ - u_char rc_hotchar; /* end packed optimize */ struct tty rc_tp; /* tty struct */ u_char *rc_iptr; /* Chars input buffer */ u_char *rc_hiwat; /* hi-water mark */ @@ -491,7 +490,7 @@ rc_intr(void *arg) optr[INPUT_FLAGS_SHIFT] = 0; optr++; sc->sc_scheduled_event++; - if (val != 0 && val == rc->rc_hotchar) + if (val != 0 && val == rc->rc_tp.t_hotchar) swi_sched(sc->sc_swicookie, 0); } } else { @@ -522,7 +521,7 @@ rc_intr(void *arg) || ((iack & RCSR_PE) && (rc->rc_tp.t_iflag & INPCK)))) val = 0; - else if (val != 0 && val == rc->rc_hotchar) + else if (val != 0 && val == rc->rc_tp.t_hotchar) swi_sched(sc->sc_swicookie, 0); optr[0] = val; optr[INPUT_FLAGS_SHIFT] = iack; @@ -935,7 +934,7 @@ again: goto again; } error = ttyld_open(tp, dev); - rc->rc_hotchar = ttyldoptim(tp); + ttyldoptim(tp); if ((tp->t_state & TS_ISOPEN) && CALLOUT(dev)) rc->rc_flags |= RC_ACTOUT; out: @@ -964,7 +963,7 @@ rcclose(struct cdev *dev, int flag, int mode, d_thread_t *td) #endif s = spltty(); ttyld_close(tp, flag); - rc->rc_hotchar = ttyldoptim(tp); + ttyldoptim(tp); rc_hardclose(rc); ttyclose(tp); splx(s); @@ -1154,7 +1153,7 @@ rc_param(struct tty *tp, struct termios *ts) CCRCMD(sc, rc->rc_chan, CCR_CORCHG1 | CCR_CORCHG2 | CCR_CORCHG3); - rc->rc_hotchar = ttyldoptim(tp); + ttyldoptim(tp); /* modem ctl */ val = cflag & CLOCAL ? 0 : MCOR1_CDzd; @@ -1211,7 +1210,7 @@ rcioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, d_thread_t *td) rc = DEV_TO_RC(dev); tp = &rc->rc_tp; error = ttyioctl(dev, cmd, data, flag, td); - rc->rc_hotchar = ttyldoptim(tp); + ttyldoptim(tp); if (error != ENOTTY) return (error); s = spltty(); diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c index ad7d426054ab..ffe26cb37ad4 100644 --- a/sys/dev/si/si.c +++ b/sys/dev/si/si.c @@ -742,7 +742,7 @@ open_top: } error = ttyld_open(tp, dev); - pp->sp_hotchar = ttyldoptim(tp); + ttyldoptim(tp); if (tp->t_state & TS_ISOPEN && IS_CALLOUT(mynor)) pp->sp_active_out = TRUE; @@ -1024,7 +1024,7 @@ siioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) } error = ttyioctl(dev, cmd, data, flag, td); - pp->sp_hotchar = ttyldoptim(tp); + ttyldoptim(tp); if (error != ENOTTY) goto out; diff --git a/sys/dev/si/si.h b/sys/dev/si/si.h index a0c1ebdb1118..3222e2e204d4 100644 --- a/sys/dev/si/si.h +++ b/sys/dev/si/si.h @@ -334,7 +334,6 @@ struct si_port { int sp_dtr_wait; /* DTR holddown in hz */ int sp_delta_overflows; u_int sp_wopeners; /* # procs waiting DCD */ - u_char sp_hotchar; /* ldisc specific ASAP char */ /* Initial state. */ struct termios sp_iin; struct termios sp_iout; diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 83b62ff1caaa..1dbf3c811f6c 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -216,7 +216,6 @@ struct com_s { u_char last_modem_status; /* last MSR read by intr handler */ u_char prev_modem_status; /* last MSR handled by high level */ - u_char hotchar; /* ldisc-specific char to be handled ASAP */ u_char *ibuf; /* start of input buffer */ u_char *ibufend; /* end of input buffer */ u_char *ibufold; /* old input buffer, to be freed */ @@ -1383,7 +1382,7 @@ open_top: goto open_top; } error = ttyld_open(tp, dev); - com->hotchar = ttyldoptim(tp); + ttyldoptim(tp); if (tp->t_state & TS_ISOPEN && mynor & CALLOUT_MASK) com->active_out = TRUE; siosettimeout(); @@ -1424,7 +1423,7 @@ sioclose(dev, flag, mode, td) tp = com->tp; s = spltty(); ttyld_close(tp, flag); - com->hotchar = ttyldoptim(tp); + ttyldoptim(tp); comhardclose(com); ttyclose(tp); siosettimeout(); @@ -1876,7 +1875,7 @@ siointr1(com) recv_data = 0; } ++com->bytes_in; - if (com->hotchar != 0 && recv_data == com->hotchar) + if (com->tp->t_hotchar != 0 && recv_data == com->tp->t_hotchar) swi_sched(sio_fast_ih, 0); ioptr = com->iptr; if (ioptr >= com->ibufend) @@ -2107,7 +2106,7 @@ sioioctl(dev, cmd, data, flag, td) dt->c_ospeed = tp->t_ospeed; } error = ttyioctl(dev, cmd, data, flag, td); - com->hotchar = ttyldoptim(tp); + ttyldoptim(tp); if (error != ENOTTY) return (error); s = spltty(); @@ -2375,7 +2374,7 @@ comparam(tp, t) sio_setreg(com, com_cfcr, com->cfcr_image = cfcr); /* XXX shouldn't call functions while intrs are disabled. */ - com->hotchar = ttyldoptim(tp); + ttyldoptim(tp); mtx_unlock_spin(&sio_lock); splx(s); diff --git a/sys/dev/sx/sx.c b/sys/dev/sx/sx.c index 8a523fa378b7..e7f5d82904c4 100644 --- a/sys/dev/sx/sx.c +++ b/sys/dev/sx/sx.c @@ -477,7 +477,7 @@ open_top: } error = ttyld_open(tp, dev); - pp->sp_hotchar = ttyldoptim(tp); + ttyldoptim(tp); if (tp->t_state & TS_ISOPEN && DEV_IS_CALLOUT(mynor)) pp->sp_active_out = TRUE; @@ -812,7 +812,7 @@ sxioctl( } error = ttyioctl(dev, cmd, data, flag, p); - pp->sp_hotchar = ttyldoptim(tp); + ttyldoptim(tp); if (error != ENOTTY) goto out; diff --git a/sys/dev/sx/sx.h b/sys/dev/sx/sx.h index 5d142a7c4346..3d4c9710461b 100644 --- a/sys/dev/sx/sx.h +++ b/sys/dev/sx/sx.h @@ -42,7 +42,6 @@ struct sx_port { int sp_dtr_wait; /* DTR holddown in hz */ int sp_delta_overflows; u_int sp_wopeners; /* Processes waiting for DCD. */ - u_char sp_hotchar; /* ldisc specific ASAP char */ struct termios sp_iin; /* Initial state. */ struct termios sp_iout; struct termios sp_lin; /* Lock state. */ diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index 82245b790899..2d28cf7c487f 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -66,11 +66,6 @@ __FBSDID("$FreeBSD$"); * POSSIBILITY OF SUCH DAMAGE. */ -/* - * TODO: - * 1. How do I handle hotchar? - */ - #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -401,7 +396,7 @@ ucomopen(struct cdev *dev, int flag, int mode, usb_proc_ptr p) if (error) goto bad; - sc->hotchar = ttyldoptim(tp); + ttyldoptim(tp); DPRINTF(("%s: ucomopen: success\n", USBDEVNAME(sc->sc_dev))); @@ -461,7 +456,7 @@ ucomclose(struct cdev *dev, int flag, int mode, usb_proc_ptr p) s = spltty(); ttyld_close(tp, flag); - sc->hotchar = ttyldoptim(tp); + ttyldoptim(tp); ttyclose(tp); splx(s); @@ -563,7 +558,7 @@ ucomioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p) #endif error = ttyioctl(dev, cmd, data, flag, p); - sc->hotchar = ttyldoptim(tp); + ttyldoptim(tp); if (error != ENOTTY) { DPRINTF(("ucomioctl: l_ioctl: error = %d\n", error)); return (error); @@ -823,7 +818,7 @@ ucomparam(struct tty *tp, struct termios *t) (void)ucomctl(sc, UMCR_RTS, DMBIS); } - sc->hotchar = ttyldoptim(tp); + ttyldoptim(tp); uerr = ucomstartread(sc); if (uerr != USBD_NORMAL_COMPLETION) diff --git a/sys/dev/usb/ucomvar.h b/sys/dev/usb/ucomvar.h index 63146b9721ee..818c3245a839 100644 --- a/sys/dev/usb/ucomvar.h +++ b/sys/dev/usb/ucomvar.h @@ -163,7 +163,6 @@ struct ucom_softc { int sc_state; int sc_poll; - u_char hotchar; u_char sc_lsr; u_char sc_msr; |