mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
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().
This commit is contained in:
parent
b366737bf0
commit
4ce7d32178
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9754
@ -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 @@ siopoll()
|
||||
|| 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. */
|
||||
}
|
||||
|
@ -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 @@ siopoll()
|
||||
|| 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. */
|
||||
}
|
||||
|
@ -693,7 +693,7 @@ void rcpoll()
|
||||
|| (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
|
||||
|
@ -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 @@ siopoll()
|
||||
|| 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. */
|
||||
}
|
||||
|
@ -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 @@ siopoll()
|
||||
|| 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. */
|
||||
}
|
||||
|
@ -693,7 +693,7 @@ void rcpoll()
|
||||
|| (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
|
||||
|
@ -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 @@ siopoll()
|
||||
|| 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. */
|
||||
}
|
||||
|
@ -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 @@ siopoll()
|
||||
|| 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. */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user