summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-07-29 04:05:57 +0000
committerbde <bde@FreeBSD.org>1995-07-29 04:05:57 +0000
commitfc1f58e6bbb8b5f01b0e63dbc29d6f8ce797f3b6 (patch)
tree83ebf6956051d1ef9894f27f80de68e1034d8f96
parent74ba692f9541a63e7a4a98df507d39a8b5811768 (diff)
downloadFreeBSD-src-fc1f58e6bbb8b5f01b0e63dbc29d6f8ce797f3b6.zip
FreeBSD-src-fc1f58e6bbb8b5f01b0e63dbc29d6f8ce797f3b6.tar.gz
Always wake up writers after clearing TS_BUSY. This will soon be
essential when I fix excessive wakeups for output-below-low-water. In cy.c and sio.c, wake up via the driver start routine to also eliminate duplicated code involving the clearing of TS_TTSTOP. Always (except in code to be replaced soon) call driver start routine directly instead of going through ttstart().
-rw-r--r--sys/dev/cy/cy.c29
-rw-r--r--sys/dev/cy/cy_isa.c29
-rw-r--r--sys/dev/rc/rc.c3
-rw-r--r--sys/dev/sio/sio.c11
-rw-r--r--sys/i386/isa/cy.c29
-rw-r--r--sys/i386/isa/rc.c3
-rw-r--r--sys/i386/isa/sio.c11
-rw-r--r--sys/isa/sio.c11
8 files changed, 31 insertions, 95 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index 20737bf..1bca887 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.10 1995/07/22 01:29:58 bde Exp $
+ * $Id: cy.c,v 1.11 1995/07/22 16:44:46 bde Exp $
*/
#include "cy.h"
@@ -184,7 +184,7 @@
* The following com and tty flags correspond closely:
* CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and
* siostop())
- * CS_TTGO = ~TS_TTSTOP (maintained by comstart() and siostop())
+ * CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart())
* CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam())
* CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam())
* TS_FLUSH is not used.
@@ -1642,7 +1642,7 @@ repeat:
|| tp->t_cc[VSTART] == tp->t_cc[VSTOP])) {
tp->t_state &= ~TS_TTSTOP;
tp->t_lflag &= ~FLUSHO;
- ttstart(tp);
+ comstart(tp);
}
} else {
do {
@@ -2140,12 +2140,8 @@ siostop(tp, rw)
int rw;
{
struct com_s *com;
- cy_addr iobase;
- int unit;
- unit = DEV_TO_UNIT(tp->t_dev);
- com = com_addr(unit);
- iobase = com->iobase;
+ com = com_addr(DEV_TO_UNIT(tp->t_dev));
disable_intr();
if (rw & FWRITE) {
com->obufs[0].l_queued = FALSE;
@@ -2159,23 +2155,8 @@ siostop(tp, rw)
com_events -= (com->iptr - com->ibuf);
com->iptr = com->ibuf;
}
- if (tp->t_state & TS_TTSTOP) {
- com->state &= ~CS_TTGO;
- if (com->intr_enable & CD1400_SRER_TXRDY) {
- cd_outb(iobase, CD1400_CAR, unit & CD1400_CAR_CHAN);
- cd_outb(iobase, CD1400_SRER,
- com->intr_enable &= ~CD1400_SRER_TXRDY);
- }
- } else {
- com->state |= CS_TTGO;
- if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)
- && !(com->intr_enable & CD1400_SRER_TXRDY)) {
- cd_outb(iobase, CD1400_CAR, unit & CD1400_CAR_CHAN);
- cd_outb(iobase, CD1400_SRER,
- com->intr_enable |= CD1400_SRER_TXRDY);
- }
- }
enable_intr();
+ comstart(tp);
/* XXX should clear h/w fifos too. */
}
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index 20737bf..1bca887 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.10 1995/07/22 01:29:58 bde Exp $
+ * $Id: cy.c,v 1.11 1995/07/22 16:44:46 bde Exp $
*/
#include "cy.h"
@@ -184,7 +184,7 @@
* The following com and tty flags correspond closely:
* CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and
* siostop())
- * CS_TTGO = ~TS_TTSTOP (maintained by comstart() and siostop())
+ * CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart())
* CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam())
* CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam())
* TS_FLUSH is not used.
@@ -1642,7 +1642,7 @@ repeat:
|| tp->t_cc[VSTART] == tp->t_cc[VSTOP])) {
tp->t_state &= ~TS_TTSTOP;
tp->t_lflag &= ~FLUSHO;
- ttstart(tp);
+ comstart(tp);
}
} else {
do {
@@ -2140,12 +2140,8 @@ siostop(tp, rw)
int rw;
{
struct com_s *com;
- cy_addr iobase;
- int unit;
- unit = DEV_TO_UNIT(tp->t_dev);
- com = com_addr(unit);
- iobase = com->iobase;
+ com = com_addr(DEV_TO_UNIT(tp->t_dev));
disable_intr();
if (rw & FWRITE) {
com->obufs[0].l_queued = FALSE;
@@ -2159,23 +2155,8 @@ siostop(tp, rw)
com_events -= (com->iptr - com->ibuf);
com->iptr = com->ibuf;
}
- if (tp->t_state & TS_TTSTOP) {
- com->state &= ~CS_TTGO;
- if (com->intr_enable & CD1400_SRER_TXRDY) {
- cd_outb(iobase, CD1400_CAR, unit & CD1400_CAR_CHAN);
- cd_outb(iobase, CD1400_SRER,
- com->intr_enable &= ~CD1400_SRER_TXRDY);
- }
- } else {
- com->state |= CS_TTGO;
- if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)
- && !(com->intr_enable & CD1400_SRER_TXRDY)) {
- cd_outb(iobase, CD1400_CAR, unit & CD1400_CAR_CHAN);
- cd_outb(iobase, CD1400_SRER,
- com->intr_enable |= CD1400_SRER_TXRDY);
- }
- }
enable_intr();
+ comstart(tp);
/* XXX should clear h/w fifos too. */
}
diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c
index 07e0264..e496a48 100644
--- a/sys/dev/rc/rc.c
+++ b/sys/dev/rc/rc.c
@@ -693,7 +693,7 @@ repeat:
|| (tp->t_cc[VSTART] == tp->t_cc[VSTOP]))) {
tp->t_state &= ~TS_TTSTOP;
tp->t_lflag &= ~FLUSHO;
- ttstart(tp);
+ rc_start(tp);
}
} else {
for (; tptr < eptr; tptr++)
@@ -1468,6 +1468,7 @@ rc_discard_output(rc)
rc->rc_optr = rc->rc_obufend;
rc->rc_tp->t_state &= ~TS_BUSY;
enable_intr();
+ ttwwakeup(rc->rc_tp);
}
static void
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index fd30f74..93469e0 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.104 1995/07/22 01:30:02 bde Exp $
+ * $Id: sio.c,v 1.105 1995/07/22 16:44:50 bde Exp $
*/
#include "sio.h"
@@ -114,7 +114,7 @@
* The following com and tty flags correspond closely:
* CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and
* siostop())
- * CS_TTGO = ~TS_TTSTOP (maintained by comstart() and siostop())
+ * CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart())
* CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam())
* CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam())
* TS_FLUSH is not used.
@@ -1591,7 +1591,7 @@ repeat:
|| tp->t_cc[VSTART] == tp->t_cc[VSTOP])) {
tp->t_state &= ~TS_TTSTOP;
tp->t_lflag &= ~FLUSHO;
- ttstart(tp);
+ comstart(tp);
}
} else {
do {
@@ -1886,11 +1886,8 @@ siostop(tp, rw)
com_events -= (com->iptr - com->ibuf);
com->iptr = com->ibuf;
}
- if (tp->t_state & TS_TTSTOP)
- com->state &= ~CS_TTGO;
- else
- com->state |= CS_TTGO;
enable_intr();
+ comstart(tp);
/* XXX should clear h/w fifos too. */
}
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index 20737bf..1bca887 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.10 1995/07/22 01:29:58 bde Exp $
+ * $Id: cy.c,v 1.11 1995/07/22 16:44:46 bde Exp $
*/
#include "cy.h"
@@ -184,7 +184,7 @@
* The following com and tty flags correspond closely:
* CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and
* siostop())
- * CS_TTGO = ~TS_TTSTOP (maintained by comstart() and siostop())
+ * CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart())
* CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam())
* CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam())
* TS_FLUSH is not used.
@@ -1642,7 +1642,7 @@ repeat:
|| tp->t_cc[VSTART] == tp->t_cc[VSTOP])) {
tp->t_state &= ~TS_TTSTOP;
tp->t_lflag &= ~FLUSHO;
- ttstart(tp);
+ comstart(tp);
}
} else {
do {
@@ -2140,12 +2140,8 @@ siostop(tp, rw)
int rw;
{
struct com_s *com;
- cy_addr iobase;
- int unit;
- unit = DEV_TO_UNIT(tp->t_dev);
- com = com_addr(unit);
- iobase = com->iobase;
+ com = com_addr(DEV_TO_UNIT(tp->t_dev));
disable_intr();
if (rw & FWRITE) {
com->obufs[0].l_queued = FALSE;
@@ -2159,23 +2155,8 @@ siostop(tp, rw)
com_events -= (com->iptr - com->ibuf);
com->iptr = com->ibuf;
}
- if (tp->t_state & TS_TTSTOP) {
- com->state &= ~CS_TTGO;
- if (com->intr_enable & CD1400_SRER_TXRDY) {
- cd_outb(iobase, CD1400_CAR, unit & CD1400_CAR_CHAN);
- cd_outb(iobase, CD1400_SRER,
- com->intr_enable &= ~CD1400_SRER_TXRDY);
- }
- } else {
- com->state |= CS_TTGO;
- if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)
- && !(com->intr_enable & CD1400_SRER_TXRDY)) {
- cd_outb(iobase, CD1400_CAR, unit & CD1400_CAR_CHAN);
- cd_outb(iobase, CD1400_SRER,
- com->intr_enable |= CD1400_SRER_TXRDY);
- }
- }
enable_intr();
+ comstart(tp);
/* XXX should clear h/w fifos too. */
}
diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c
index 07e0264..e496a48 100644
--- a/sys/i386/isa/rc.c
+++ b/sys/i386/isa/rc.c
@@ -693,7 +693,7 @@ repeat:
|| (tp->t_cc[VSTART] == tp->t_cc[VSTOP]))) {
tp->t_state &= ~TS_TTSTOP;
tp->t_lflag &= ~FLUSHO;
- ttstart(tp);
+ rc_start(tp);
}
} else {
for (; tptr < eptr; tptr++)
@@ -1468,6 +1468,7 @@ rc_discard_output(rc)
rc->rc_optr = rc->rc_obufend;
rc->rc_tp->t_state &= ~TS_BUSY;
enable_intr();
+ ttwwakeup(rc->rc_tp);
}
static void
diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c
index fd30f74..93469e0 100644
--- a/sys/i386/isa/sio.c
+++ b/sys/i386/isa/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.104 1995/07/22 01:30:02 bde Exp $
+ * $Id: sio.c,v 1.105 1995/07/22 16:44:50 bde Exp $
*/
#include "sio.h"
@@ -114,7 +114,7 @@
* The following com and tty flags correspond closely:
* CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and
* siostop())
- * CS_TTGO = ~TS_TTSTOP (maintained by comstart() and siostop())
+ * CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart())
* CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam())
* CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam())
* TS_FLUSH is not used.
@@ -1591,7 +1591,7 @@ repeat:
|| tp->t_cc[VSTART] == tp->t_cc[VSTOP])) {
tp->t_state &= ~TS_TTSTOP;
tp->t_lflag &= ~FLUSHO;
- ttstart(tp);
+ comstart(tp);
}
} else {
do {
@@ -1886,11 +1886,8 @@ siostop(tp, rw)
com_events -= (com->iptr - com->ibuf);
com->iptr = com->ibuf;
}
- if (tp->t_state & TS_TTSTOP)
- com->state &= ~CS_TTGO;
- else
- com->state |= CS_TTGO;
enable_intr();
+ comstart(tp);
/* XXX should clear h/w fifos too. */
}
diff --git a/sys/isa/sio.c b/sys/isa/sio.c
index fd30f74..93469e0 100644
--- a/sys/isa/sio.c
+++ b/sys/isa/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.104 1995/07/22 01:30:02 bde Exp $
+ * $Id: sio.c,v 1.105 1995/07/22 16:44:50 bde Exp $
*/
#include "sio.h"
@@ -114,7 +114,7 @@
* The following com and tty flags correspond closely:
* CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and
* siostop())
- * CS_TTGO = ~TS_TTSTOP (maintained by comstart() and siostop())
+ * CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart())
* CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam())
* CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam())
* TS_FLUSH is not used.
@@ -1591,7 +1591,7 @@ repeat:
|| tp->t_cc[VSTART] == tp->t_cc[VSTOP])) {
tp->t_state &= ~TS_TTSTOP;
tp->t_lflag &= ~FLUSHO;
- ttstart(tp);
+ comstart(tp);
}
} else {
do {
@@ -1886,11 +1886,8 @@ siostop(tp, rw)
com_events -= (com->iptr - com->ibuf);
com->iptr = com->ibuf;
}
- if (tp->t_state & TS_TTSTOP)
- com->state &= ~CS_TTGO;
- else
- com->state |= CS_TTGO;
enable_intr();
+ comstart(tp);
/* XXX should clear h/w fifos too. */
}
OpenPOWER on IntegriCloud