From 3461d589f27adbc21d3313e25d31e0313a89c3b8 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sun, 5 May 1996 17:35:19 +0000 Subject: [PATCH] Change the logic of the interrupt/poll loop. It no longer loops until it empties all of the 256 byte incoming fifo, as it can spend more time processing one port than intended, especially if data is streaming in at 115.2K. The port fifo will be emptied and dumped into the tty system and left until next time. I've been running this for quite some time on one of my systems here. Also, if the tty layer is blocked or full it lets the hardware assert the flow control rather than loosing the data. --- sys/dev/si/si.c | 19 +++++++++++++++---- sys/i386/isa/si.c | 19 +++++++++++++++---- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c index e60a0872ed73..a607fdda00ce 100644 --- a/sys/dev/si/si.c +++ b/sys/dev/si/si.c @@ -30,7 +30,7 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHORS BE LIABLE. * - * $Id: si.c,v 1.37 1996/03/28 14:28:51 scrappy Exp $ + * $Id: si.c,v 1.38 1996/05/05 17:09:04 peter Exp $ */ #ifndef lint @@ -1890,17 +1890,28 @@ siintr(int unit) goto end_rx; } + /* + * If the tty input buffers are blocked, stop emptying + * the incoming buffers and let the auto flow control + * assert.. + */ + if (tp->t_state & TS_TBLOCK) { + goto end_rx; + } + /* * Process read characters if not skipped above */ - c = ccbp->hi_rxipos - ccbp->hi_rxopos; + op = ccbp->hi_rxopos; + ip = ccbp->hi_rxipos; + c = ip - op; if (c == 0) { goto end_rx; } - op = ccbp->hi_rxopos; - ip = ccbp->hi_rxipos; n = c & 0xff; + if (n > 250) + n = 250; DPRINT((pp, DBG_INTR, "n = %d, op = %d, ip = %d\n", n, op, ip)); diff --git a/sys/i386/isa/si.c b/sys/i386/isa/si.c index e60a0872ed73..a607fdda00ce 100644 --- a/sys/i386/isa/si.c +++ b/sys/i386/isa/si.c @@ -30,7 +30,7 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHORS BE LIABLE. * - * $Id: si.c,v 1.37 1996/03/28 14:28:51 scrappy Exp $ + * $Id: si.c,v 1.38 1996/05/05 17:09:04 peter Exp $ */ #ifndef lint @@ -1890,17 +1890,28 @@ siintr(int unit) goto end_rx; } + /* + * If the tty input buffers are blocked, stop emptying + * the incoming buffers and let the auto flow control + * assert.. + */ + if (tp->t_state & TS_TBLOCK) { + goto end_rx; + } + /* * Process read characters if not skipped above */ - c = ccbp->hi_rxipos - ccbp->hi_rxopos; + op = ccbp->hi_rxopos; + ip = ccbp->hi_rxipos; + c = ip - op; if (c == 0) { goto end_rx; } - op = ccbp->hi_rxopos; - ip = ccbp->hi_rxipos; n = c & 0xff; + if (n > 250) + n = 250; DPRINT((pp, DBG_INTR, "n = %d, op = %d, ip = %d\n", n, op, ip));