Use new TS_CAN_BYPASS_L_RINT state to avoid complex test
each time. Remove unefficient loop of zeroing error chars in siopoll(), now done at interrupt level.
This commit is contained in:
parent
3c0c5e2163
commit
c6e19ceaa0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7553
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.79 1995/03/29 20:20:01 ache Exp $
|
||||
* $Id: sio.c,v 1.80 1995/04/01 06:55:24 ache Exp $
|
||||
*/
|
||||
|
||||
#include "sio.h"
|
||||
@ -1111,6 +1111,12 @@ siointr1(com)
|
||||
|| (line_status & LSR_BI)
|
||||
&& (com->tp->t_iflag & IGNBRK))
|
||||
goto cont;
|
||||
if ( (line_status & (LSR_PE|LSR_FE))
|
||||
&& (com->tp->t_state & TS_CAN_BYPASS_L_RINT)
|
||||
&& ((line_status & LSR_FE)
|
||||
|| (line_status & LSR_PE)
|
||||
&& (com->tp->t_iflag & INPCK)))
|
||||
recv_data = 0;
|
||||
}
|
||||
++com->bytes_in;
|
||||
if (com->hotchar != 0 && recv_data == com->hotchar)
|
||||
@ -1557,27 +1563,8 @@ siopoll()
|
||||
* slinput is reasonably fast (usually 40 instructions plus
|
||||
* call overhead).
|
||||
*/
|
||||
if (!(tp->t_iflag & (ICRNL | IGNCR | IMAXBEL | INLCR | ISTRIP
|
||||
| IXOFF | IXON))
|
||||
&& (!(tp->t_iflag & BRKINT) || (tp->t_iflag & IGNBRK))
|
||||
&& (!(tp->t_iflag & PARMRK) ||
|
||||
(tp->t_iflag & (IGNPAR|IGNBRK)) == (IGNPAR|IGNBRK))
|
||||
&& !(tp->t_lflag & (ECHO | ECHONL | ICANON | IEXTEN | ISIG
|
||||
| PENDIN))
|
||||
&& !(tp->t_state & (TS_CNTTB | TS_LNCH))
|
||||
&& linesw[tp->t_line].l_rint == ttyinput) {
|
||||
u_char *scan = buf;
|
||||
int cnt = incc;
|
||||
|
||||
/* Zero PE & FE chars per POSIX spec. and 4.4 ttyinput() */
|
||||
while (cnt--) {
|
||||
if ( (scan[CE_INPUT_OFFSET] & LSR_FE)
|
||||
|| (scan[CE_INPUT_OFFSET] & LSR_PE)
|
||||
&& (tp->t_iflag & INPCK))
|
||||
scan[0] = 0;
|
||||
scan++;
|
||||
}
|
||||
|
||||
if ( (tp->t_state & TS_CAN_BYPASS_L_RINT)
|
||||
&& !(tp->t_state & TS_LOCAL)) {
|
||||
tk_nin += incc;
|
||||
tk_rawcc += incc;
|
||||
tp->t_rawcc += incc;
|
||||
@ -1625,7 +1612,7 @@ comparam(tp, t)
|
||||
struct termios *t;
|
||||
{
|
||||
u_int cfcr;
|
||||
int cflag;
|
||||
int cflag, iflag, lflag;
|
||||
struct com_s *com;
|
||||
int divisor;
|
||||
int error;
|
||||
@ -1650,6 +1637,8 @@ comparam(tp, t)
|
||||
else
|
||||
commctl(com, MCR_DTR, DMBIS);
|
||||
cflag = t->c_cflag;
|
||||
iflag = t->c_iflag;
|
||||
lflag = t->c_lflag;
|
||||
switch (cflag & CSIZE) {
|
||||
case CS5:
|
||||
cfcr = CFCR_5BITS;
|
||||
@ -1727,6 +1716,8 @@ comparam(tp, t)
|
||||
!= (LSR_TSRE | LSR_TXRDY))
|
||||
goto retry;
|
||||
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
|
||||
if (divisor != 0) {
|
||||
outb(iobase + com_cfcr, cfcr | CFCR_DLAB);
|
||||
outb(iobase + com_dlbl, divisor & 0xFF);
|
||||
@ -1753,6 +1744,15 @@ comparam(tp, t)
|
||||
com->state &= ~CS_ODEVREADY;
|
||||
}
|
||||
|
||||
if (!(iflag & (ICRNL | IGNCR | IMAXBEL | INLCR | ISTRIP
|
||||
| IXOFF | IXON))
|
||||
&& (!(iflag & BRKINT) || (iflag & IGNBRK))
|
||||
&& (!(iflag & PARMRK) ||
|
||||
(iflag & (IGNPAR|IGNBRK)) == (IGNPAR|IGNBRK))
|
||||
&& !(lflag & (ECHO | ECHONL | ICANON | IEXTEN | ISIG
|
||||
| PENDIN))
|
||||
&& linesw[tp->t_line].l_rint == ttyinput)
|
||||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
/*
|
||||
* Recover from fiddling with CS_TTGO. We used to call siointr1()
|
||||
* unconditionally, but that defeated the careful discarding of
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.79 1995/03/29 20:20:01 ache Exp $
|
||||
* $Id: sio.c,v 1.80 1995/04/01 06:55:24 ache Exp $
|
||||
*/
|
||||
|
||||
#include "sio.h"
|
||||
@ -1111,6 +1111,12 @@ siointr1(com)
|
||||
|| (line_status & LSR_BI)
|
||||
&& (com->tp->t_iflag & IGNBRK))
|
||||
goto cont;
|
||||
if ( (line_status & (LSR_PE|LSR_FE))
|
||||
&& (com->tp->t_state & TS_CAN_BYPASS_L_RINT)
|
||||
&& ((line_status & LSR_FE)
|
||||
|| (line_status & LSR_PE)
|
||||
&& (com->tp->t_iflag & INPCK)))
|
||||
recv_data = 0;
|
||||
}
|
||||
++com->bytes_in;
|
||||
if (com->hotchar != 0 && recv_data == com->hotchar)
|
||||
@ -1557,27 +1563,8 @@ siopoll()
|
||||
* slinput is reasonably fast (usually 40 instructions plus
|
||||
* call overhead).
|
||||
*/
|
||||
if (!(tp->t_iflag & (ICRNL | IGNCR | IMAXBEL | INLCR | ISTRIP
|
||||
| IXOFF | IXON))
|
||||
&& (!(tp->t_iflag & BRKINT) || (tp->t_iflag & IGNBRK))
|
||||
&& (!(tp->t_iflag & PARMRK) ||
|
||||
(tp->t_iflag & (IGNPAR|IGNBRK)) == (IGNPAR|IGNBRK))
|
||||
&& !(tp->t_lflag & (ECHO | ECHONL | ICANON | IEXTEN | ISIG
|
||||
| PENDIN))
|
||||
&& !(tp->t_state & (TS_CNTTB | TS_LNCH))
|
||||
&& linesw[tp->t_line].l_rint == ttyinput) {
|
||||
u_char *scan = buf;
|
||||
int cnt = incc;
|
||||
|
||||
/* Zero PE & FE chars per POSIX spec. and 4.4 ttyinput() */
|
||||
while (cnt--) {
|
||||
if ( (scan[CE_INPUT_OFFSET] & LSR_FE)
|
||||
|| (scan[CE_INPUT_OFFSET] & LSR_PE)
|
||||
&& (tp->t_iflag & INPCK))
|
||||
scan[0] = 0;
|
||||
scan++;
|
||||
}
|
||||
|
||||
if ( (tp->t_state & TS_CAN_BYPASS_L_RINT)
|
||||
&& !(tp->t_state & TS_LOCAL)) {
|
||||
tk_nin += incc;
|
||||
tk_rawcc += incc;
|
||||
tp->t_rawcc += incc;
|
||||
@ -1625,7 +1612,7 @@ comparam(tp, t)
|
||||
struct termios *t;
|
||||
{
|
||||
u_int cfcr;
|
||||
int cflag;
|
||||
int cflag, iflag, lflag;
|
||||
struct com_s *com;
|
||||
int divisor;
|
||||
int error;
|
||||
@ -1650,6 +1637,8 @@ comparam(tp, t)
|
||||
else
|
||||
commctl(com, MCR_DTR, DMBIS);
|
||||
cflag = t->c_cflag;
|
||||
iflag = t->c_iflag;
|
||||
lflag = t->c_lflag;
|
||||
switch (cflag & CSIZE) {
|
||||
case CS5:
|
||||
cfcr = CFCR_5BITS;
|
||||
@ -1727,6 +1716,8 @@ comparam(tp, t)
|
||||
!= (LSR_TSRE | LSR_TXRDY))
|
||||
goto retry;
|
||||
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
|
||||
if (divisor != 0) {
|
||||
outb(iobase + com_cfcr, cfcr | CFCR_DLAB);
|
||||
outb(iobase + com_dlbl, divisor & 0xFF);
|
||||
@ -1753,6 +1744,15 @@ comparam(tp, t)
|
||||
com->state &= ~CS_ODEVREADY;
|
||||
}
|
||||
|
||||
if (!(iflag & (ICRNL | IGNCR | IMAXBEL | INLCR | ISTRIP
|
||||
| IXOFF | IXON))
|
||||
&& (!(iflag & BRKINT) || (iflag & IGNBRK))
|
||||
&& (!(iflag & PARMRK) ||
|
||||
(iflag & (IGNPAR|IGNBRK)) == (IGNPAR|IGNBRK))
|
||||
&& !(lflag & (ECHO | ECHONL | ICANON | IEXTEN | ISIG
|
||||
| PENDIN))
|
||||
&& linesw[tp->t_line].l_rint == ttyinput)
|
||||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
/*
|
||||
* Recover from fiddling with CS_TTGO. We used to call siointr1()
|
||||
* unconditionally, but that defeated the careful discarding of
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.79 1995/03/29 20:20:01 ache Exp $
|
||||
* $Id: sio.c,v 1.80 1995/04/01 06:55:24 ache Exp $
|
||||
*/
|
||||
|
||||
#include "sio.h"
|
||||
@ -1111,6 +1111,12 @@ siointr1(com)
|
||||
|| (line_status & LSR_BI)
|
||||
&& (com->tp->t_iflag & IGNBRK))
|
||||
goto cont;
|
||||
if ( (line_status & (LSR_PE|LSR_FE))
|
||||
&& (com->tp->t_state & TS_CAN_BYPASS_L_RINT)
|
||||
&& ((line_status & LSR_FE)
|
||||
|| (line_status & LSR_PE)
|
||||
&& (com->tp->t_iflag & INPCK)))
|
||||
recv_data = 0;
|
||||
}
|
||||
++com->bytes_in;
|
||||
if (com->hotchar != 0 && recv_data == com->hotchar)
|
||||
@ -1557,27 +1563,8 @@ siopoll()
|
||||
* slinput is reasonably fast (usually 40 instructions plus
|
||||
* call overhead).
|
||||
*/
|
||||
if (!(tp->t_iflag & (ICRNL | IGNCR | IMAXBEL | INLCR | ISTRIP
|
||||
| IXOFF | IXON))
|
||||
&& (!(tp->t_iflag & BRKINT) || (tp->t_iflag & IGNBRK))
|
||||
&& (!(tp->t_iflag & PARMRK) ||
|
||||
(tp->t_iflag & (IGNPAR|IGNBRK)) == (IGNPAR|IGNBRK))
|
||||
&& !(tp->t_lflag & (ECHO | ECHONL | ICANON | IEXTEN | ISIG
|
||||
| PENDIN))
|
||||
&& !(tp->t_state & (TS_CNTTB | TS_LNCH))
|
||||
&& linesw[tp->t_line].l_rint == ttyinput) {
|
||||
u_char *scan = buf;
|
||||
int cnt = incc;
|
||||
|
||||
/* Zero PE & FE chars per POSIX spec. and 4.4 ttyinput() */
|
||||
while (cnt--) {
|
||||
if ( (scan[CE_INPUT_OFFSET] & LSR_FE)
|
||||
|| (scan[CE_INPUT_OFFSET] & LSR_PE)
|
||||
&& (tp->t_iflag & INPCK))
|
||||
scan[0] = 0;
|
||||
scan++;
|
||||
}
|
||||
|
||||
if ( (tp->t_state & TS_CAN_BYPASS_L_RINT)
|
||||
&& !(tp->t_state & TS_LOCAL)) {
|
||||
tk_nin += incc;
|
||||
tk_rawcc += incc;
|
||||
tp->t_rawcc += incc;
|
||||
@ -1625,7 +1612,7 @@ comparam(tp, t)
|
||||
struct termios *t;
|
||||
{
|
||||
u_int cfcr;
|
||||
int cflag;
|
||||
int cflag, iflag, lflag;
|
||||
struct com_s *com;
|
||||
int divisor;
|
||||
int error;
|
||||
@ -1650,6 +1637,8 @@ comparam(tp, t)
|
||||
else
|
||||
commctl(com, MCR_DTR, DMBIS);
|
||||
cflag = t->c_cflag;
|
||||
iflag = t->c_iflag;
|
||||
lflag = t->c_lflag;
|
||||
switch (cflag & CSIZE) {
|
||||
case CS5:
|
||||
cfcr = CFCR_5BITS;
|
||||
@ -1727,6 +1716,8 @@ comparam(tp, t)
|
||||
!= (LSR_TSRE | LSR_TXRDY))
|
||||
goto retry;
|
||||
|
||||
tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
|
||||
|
||||
if (divisor != 0) {
|
||||
outb(iobase + com_cfcr, cfcr | CFCR_DLAB);
|
||||
outb(iobase + com_dlbl, divisor & 0xFF);
|
||||
@ -1753,6 +1744,15 @@ comparam(tp, t)
|
||||
com->state &= ~CS_ODEVREADY;
|
||||
}
|
||||
|
||||
if (!(iflag & (ICRNL | IGNCR | IMAXBEL | INLCR | ISTRIP
|
||||
| IXOFF | IXON))
|
||||
&& (!(iflag & BRKINT) || (iflag & IGNBRK))
|
||||
&& (!(iflag & PARMRK) ||
|
||||
(iflag & (IGNPAR|IGNBRK)) == (IGNPAR|IGNBRK))
|
||||
&& !(lflag & (ECHO | ECHONL | ICANON | IEXTEN | ISIG
|
||||
| PENDIN))
|
||||
&& linesw[tp->t_line].l_rint == ttyinput)
|
||||
tp->t_state |= TS_CAN_BYPASS_L_RINT;
|
||||
/*
|
||||
* Recover from fiddling with CS_TTGO. We used to call siointr1()
|
||||
* unconditionally, but that defeated the careful discarding of
|
||||
|
Loading…
Reference in New Issue
Block a user