diff options
author | ache <ache@FreeBSD.org> | 1995-04-01 12:01:13 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1995-04-01 12:01:13 +0000 |
commit | f73cd7c9f11488aa6b5d916177d1e301cd974665 (patch) | |
tree | 9813ba6109448a5309bf11223ac52e1ed2faf864 /sys/dev/sio/sio.c | |
parent | afdcd0997c8130691a5031e893b37438de519b81 (diff) | |
download | FreeBSD-src-f73cd7c9f11488aa6b5d916177d1e301cd974665.zip FreeBSD-src-f73cd7c9f11488aa6b5d916177d1e301cd974665.tar.gz |
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.
Diffstat (limited to 'sys/dev/sio/sio.c')
-rw-r--r-- | sys/dev/sio/sio.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 8dcf718..7d042b8 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.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 @@ repeat: * 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 @@ retry: != (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 @@ retry: 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 |