From 7922019b1c310404108225adb92a856d9a342298 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Mon, 31 Jul 1995 21:35:17 +0000 Subject: [PATCH] Eliminate the use of TS_TIMEOUT and ttstrt(). These are for handling tab delays etc. pcvt was using them to recover from a (rarely lost) race. Use a little more locking to avoid the race. --- sys/i386/isa/pcvt/pcvt_drv.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c index d9b69dc9e63..cdf30731991 100644 --- a/sys/i386/isa/pcvt/pcvt_drv.c +++ b/sys/i386/isa/pcvt/pcvt_drv.c @@ -928,10 +928,6 @@ pcrint(void) #if PCVT_NETBSD || PCVT_FREEBSD >= 200 -#if PCVT_NETBSD == 9 -extern void ttrstrt(); -#endif /* PCVT_NETBSD == 9 */ - void pcstart(register struct tty *tp) { @@ -950,26 +946,28 @@ pcstart(register struct tty *tp) async_update(UPDATE_KERN); - /* - * We need to do this outside spl since it could be fairly - * expensive and we don't want our serial ports to overflow. - */ - rbp = &tp->t_outq; - while (len = q_to_b(rbp, buf, PCVT_PCBURST)) - sput(&buf[0], 0, len, minor(tp->t_dev)); + /* + * Call q_to_b() at spltty() to ensure that the queue is empty when + * the loop terminates. + */ s = spltty(); - tp->t_state &= ~TS_BUSY; - - if (rbp->c_cc) + while (len = q_to_b(rbp, buf, PCVT_PCBURST)) { - tp->t_state |= TS_TIMEOUT; - timeout(ttrstrt, tp, 1); + /* + * We need to do this outside spl since it could be fairly + * expensive and we don't want our serial ports to overflow. + */ + splx(s); + sput(&buf[0], 0, len, minor(tp->t_dev)); + s = spltty(); } + tp->t_state &= ~TS_BUSY; + #ifndef TS_ASLEEP /* FreeBSD some time after 2.0.5 */ ttwwakeup(tp); #else