summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-07-31 21:35:17 +0000
committerbde <bde@FreeBSD.org>1995-07-31 21:35:17 +0000
commit55a3de39a5fcb17f72a24030269583b31084a10c (patch)
tree3f0093fbb4e2c8ba090a495691aee8687297fe80 /sys
parent59504bbc0ea6f749672ffbe9100c7cbb33f1fae4 (diff)
downloadFreeBSD-src-55a3de39a5fcb17f72a24030269583b31084a10c.zip
FreeBSD-src-55a3de39a5fcb17f72a24030269583b31084a10c.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/isa/pcvt/pcvt_drv.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c
index d9b69dc..cdf3073 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);
+ rbp = &tp->t_outq;
+
/*
- * We need to do this outside spl since it could be fairly
- * expensive and we don't want our serial ports to overflow.
+ * Call q_to_b() at spltty() to ensure that the queue is empty when
+ * the loop terminates.
*/
- rbp = &tp->t_outq;
+ s = spltty();
while (len = q_to_b(rbp, buf, PCVT_PCBURST))
+ {
+ /*
+ * 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();
+ s = spltty();
+ }
tp->t_state &= ~TS_BUSY;
- if (rbp->c_cc)
- {
- tp->t_state |= TS_TIMEOUT;
- timeout(ttrstrt, tp, 1);
- }
-
#ifndef TS_ASLEEP /* FreeBSD some time after 2.0.5 */
ttwwakeup(tp);
#else
OpenPOWER on IntegriCloud