mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
Move discard check up and do it only for error status
(per Bruce suggestion). It speedup things for a little. Remove l_start optimization, call l_start always (per Bruce suggestion)
This commit is contained in:
parent
84351cc95c
commit
0e933b8841
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7448
3 changed files with 63 additions and 69 deletions
|
@ -31,7 +31,7 @@
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||||
* $Id: sio.c,v 1.75 1995/03/28 11:13:44 ache Exp $
|
* $Id: sio.c,v 1.76 1995/03/28 12:26:40 ache Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sio.h"
|
#include "sio.h"
|
||||||
|
@ -1100,6 +1100,21 @@ siointr1(com)
|
||||||
recv_data = 0;
|
recv_data = 0;
|
||||||
else
|
else
|
||||||
recv_data = inb(com->data_port);
|
recv_data = inb(com->data_port);
|
||||||
|
if (line_status & (LSR_PE|LSR_OE|LSR_FE|LSR_BI)) {
|
||||||
|
if (line_status & LSR_OE)
|
||||||
|
CE_RECORD(com, CE_OVERRUN);
|
||||||
|
/*
|
||||||
|
Don't store PE if IGNPAR and BI if IGNBRK,
|
||||||
|
this hack allows "raw" tty optimization
|
||||||
|
works even if IGN* is set.
|
||||||
|
Assume TTY_OE mapped to TTY_PE
|
||||||
|
*/
|
||||||
|
if ( (line_status & (LSR_PE|LSR_OE|LSR_FE))
|
||||||
|
&& (com->tp->t_iflag & IGNPAR)
|
||||||
|
|| (line_status & LSR_BI)
|
||||||
|
&& (com->tp->t_iflag & IGNBRK))
|
||||||
|
goto cont;
|
||||||
|
}
|
||||||
++com->bytes_in;
|
++com->bytes_in;
|
||||||
if (com->hotchar != 0 && recv_data == com->hotchar)
|
if (com->hotchar != 0 && recv_data == com->hotchar)
|
||||||
setsofttty();
|
setsofttty();
|
||||||
|
@ -1121,29 +1136,15 @@ siointr1(com)
|
||||||
if (com->iptr - com->ibuf == 8)
|
if (com->iptr - com->ibuf == 8)
|
||||||
setsofttty();
|
setsofttty();
|
||||||
#endif
|
#endif
|
||||||
/*
|
ioptr[0] = recv_data;
|
||||||
Don't store PE if IGNPAR and BI if IGNBRK,
|
ioptr[CE_INPUT_OFFSET] = line_status;
|
||||||
this hack allows "raw" tty optimization
|
com->iptr = ++ioptr;
|
||||||
works even if IGN* is set.
|
|
||||||
Assume TTY_OE mapped to TTY_PE
|
|
||||||
*/
|
|
||||||
if ( (!(line_status & (LSR_PE|LSR_OE|LSR_FE))
|
|
||||||
|| !(com->tp->t_iflag & IGNPAR))
|
|
||||||
&& (!(line_status & LSR_BI)
|
|
||||||
|| !(com->tp->t_iflag & IGNBRK))) {
|
|
||||||
ioptr[0] = recv_data;
|
|
||||||
ioptr[CE_INPUT_OFFSET] = line_status;
|
|
||||||
com->iptr = ++ioptr;
|
|
||||||
}
|
|
||||||
if (ioptr == com->ihighwater
|
if (ioptr == com->ihighwater
|
||||||
&& com->state & CS_RTS_IFLOW)
|
&& com->state & CS_RTS_IFLOW)
|
||||||
outb(com->modem_ctl_port,
|
outb(com->modem_ctl_port,
|
||||||
com->mcr_image &= ~MCR_RTS);
|
com->mcr_image &= ~MCR_RTS);
|
||||||
/* XXX - move this out of isr */
|
|
||||||
if (line_status & LSR_OE)
|
|
||||||
CE_RECORD(com, CE_OVERRUN);
|
|
||||||
}
|
}
|
||||||
|
cont:
|
||||||
/*
|
/*
|
||||||
* "& 0x7F" is to avoid the gcc-1.40 generating a slow
|
* "& 0x7F" is to avoid the gcc-1.40 generating a slow
|
||||||
* jump from the top of the loop to here
|
* jump from the top of the loop to here
|
||||||
|
@ -1525,10 +1526,7 @@ siopoll()
|
||||||
}
|
}
|
||||||
if (com->state & CS_ODONE) {
|
if (com->state & CS_ODONE) {
|
||||||
comflush(com);
|
comflush(com);
|
||||||
if (linesw[tp->t_line].l_start != ttstart)
|
(*linesw[tp->t_line].l_start)(tp);
|
||||||
(*linesw[tp->t_line].l_start)(tp);
|
|
||||||
else
|
|
||||||
comstart(tp);
|
|
||||||
}
|
}
|
||||||
if (incc <= 0 || !(tp->t_state & TS_ISOPEN))
|
if (incc <= 0 || !(tp->t_state & TS_ISOPEN))
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||||
* $Id: sio.c,v 1.75 1995/03/28 11:13:44 ache Exp $
|
* $Id: sio.c,v 1.76 1995/03/28 12:26:40 ache Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sio.h"
|
#include "sio.h"
|
||||||
|
@ -1100,6 +1100,21 @@ siointr1(com)
|
||||||
recv_data = 0;
|
recv_data = 0;
|
||||||
else
|
else
|
||||||
recv_data = inb(com->data_port);
|
recv_data = inb(com->data_port);
|
||||||
|
if (line_status & (LSR_PE|LSR_OE|LSR_FE|LSR_BI)) {
|
||||||
|
if (line_status & LSR_OE)
|
||||||
|
CE_RECORD(com, CE_OVERRUN);
|
||||||
|
/*
|
||||||
|
Don't store PE if IGNPAR and BI if IGNBRK,
|
||||||
|
this hack allows "raw" tty optimization
|
||||||
|
works even if IGN* is set.
|
||||||
|
Assume TTY_OE mapped to TTY_PE
|
||||||
|
*/
|
||||||
|
if ( (line_status & (LSR_PE|LSR_OE|LSR_FE))
|
||||||
|
&& (com->tp->t_iflag & IGNPAR)
|
||||||
|
|| (line_status & LSR_BI)
|
||||||
|
&& (com->tp->t_iflag & IGNBRK))
|
||||||
|
goto cont;
|
||||||
|
}
|
||||||
++com->bytes_in;
|
++com->bytes_in;
|
||||||
if (com->hotchar != 0 && recv_data == com->hotchar)
|
if (com->hotchar != 0 && recv_data == com->hotchar)
|
||||||
setsofttty();
|
setsofttty();
|
||||||
|
@ -1121,29 +1136,15 @@ siointr1(com)
|
||||||
if (com->iptr - com->ibuf == 8)
|
if (com->iptr - com->ibuf == 8)
|
||||||
setsofttty();
|
setsofttty();
|
||||||
#endif
|
#endif
|
||||||
/*
|
ioptr[0] = recv_data;
|
||||||
Don't store PE if IGNPAR and BI if IGNBRK,
|
ioptr[CE_INPUT_OFFSET] = line_status;
|
||||||
this hack allows "raw" tty optimization
|
com->iptr = ++ioptr;
|
||||||
works even if IGN* is set.
|
|
||||||
Assume TTY_OE mapped to TTY_PE
|
|
||||||
*/
|
|
||||||
if ( (!(line_status & (LSR_PE|LSR_OE|LSR_FE))
|
|
||||||
|| !(com->tp->t_iflag & IGNPAR))
|
|
||||||
&& (!(line_status & LSR_BI)
|
|
||||||
|| !(com->tp->t_iflag & IGNBRK))) {
|
|
||||||
ioptr[0] = recv_data;
|
|
||||||
ioptr[CE_INPUT_OFFSET] = line_status;
|
|
||||||
com->iptr = ++ioptr;
|
|
||||||
}
|
|
||||||
if (ioptr == com->ihighwater
|
if (ioptr == com->ihighwater
|
||||||
&& com->state & CS_RTS_IFLOW)
|
&& com->state & CS_RTS_IFLOW)
|
||||||
outb(com->modem_ctl_port,
|
outb(com->modem_ctl_port,
|
||||||
com->mcr_image &= ~MCR_RTS);
|
com->mcr_image &= ~MCR_RTS);
|
||||||
/* XXX - move this out of isr */
|
|
||||||
if (line_status & LSR_OE)
|
|
||||||
CE_RECORD(com, CE_OVERRUN);
|
|
||||||
}
|
}
|
||||||
|
cont:
|
||||||
/*
|
/*
|
||||||
* "& 0x7F" is to avoid the gcc-1.40 generating a slow
|
* "& 0x7F" is to avoid the gcc-1.40 generating a slow
|
||||||
* jump from the top of the loop to here
|
* jump from the top of the loop to here
|
||||||
|
@ -1525,10 +1526,7 @@ siopoll()
|
||||||
}
|
}
|
||||||
if (com->state & CS_ODONE) {
|
if (com->state & CS_ODONE) {
|
||||||
comflush(com);
|
comflush(com);
|
||||||
if (linesw[tp->t_line].l_start != ttstart)
|
(*linesw[tp->t_line].l_start)(tp);
|
||||||
(*linesw[tp->t_line].l_start)(tp);
|
|
||||||
else
|
|
||||||
comstart(tp);
|
|
||||||
}
|
}
|
||||||
if (incc <= 0 || !(tp->t_state & TS_ISOPEN))
|
if (incc <= 0 || !(tp->t_state & TS_ISOPEN))
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||||
* $Id: sio.c,v 1.75 1995/03/28 11:13:44 ache Exp $
|
* $Id: sio.c,v 1.76 1995/03/28 12:26:40 ache Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sio.h"
|
#include "sio.h"
|
||||||
|
@ -1100,6 +1100,21 @@ siointr1(com)
|
||||||
recv_data = 0;
|
recv_data = 0;
|
||||||
else
|
else
|
||||||
recv_data = inb(com->data_port);
|
recv_data = inb(com->data_port);
|
||||||
|
if (line_status & (LSR_PE|LSR_OE|LSR_FE|LSR_BI)) {
|
||||||
|
if (line_status & LSR_OE)
|
||||||
|
CE_RECORD(com, CE_OVERRUN);
|
||||||
|
/*
|
||||||
|
Don't store PE if IGNPAR and BI if IGNBRK,
|
||||||
|
this hack allows "raw" tty optimization
|
||||||
|
works even if IGN* is set.
|
||||||
|
Assume TTY_OE mapped to TTY_PE
|
||||||
|
*/
|
||||||
|
if ( (line_status & (LSR_PE|LSR_OE|LSR_FE))
|
||||||
|
&& (com->tp->t_iflag & IGNPAR)
|
||||||
|
|| (line_status & LSR_BI)
|
||||||
|
&& (com->tp->t_iflag & IGNBRK))
|
||||||
|
goto cont;
|
||||||
|
}
|
||||||
++com->bytes_in;
|
++com->bytes_in;
|
||||||
if (com->hotchar != 0 && recv_data == com->hotchar)
|
if (com->hotchar != 0 && recv_data == com->hotchar)
|
||||||
setsofttty();
|
setsofttty();
|
||||||
|
@ -1121,29 +1136,15 @@ siointr1(com)
|
||||||
if (com->iptr - com->ibuf == 8)
|
if (com->iptr - com->ibuf == 8)
|
||||||
setsofttty();
|
setsofttty();
|
||||||
#endif
|
#endif
|
||||||
/*
|
ioptr[0] = recv_data;
|
||||||
Don't store PE if IGNPAR and BI if IGNBRK,
|
ioptr[CE_INPUT_OFFSET] = line_status;
|
||||||
this hack allows "raw" tty optimization
|
com->iptr = ++ioptr;
|
||||||
works even if IGN* is set.
|
|
||||||
Assume TTY_OE mapped to TTY_PE
|
|
||||||
*/
|
|
||||||
if ( (!(line_status & (LSR_PE|LSR_OE|LSR_FE))
|
|
||||||
|| !(com->tp->t_iflag & IGNPAR))
|
|
||||||
&& (!(line_status & LSR_BI)
|
|
||||||
|| !(com->tp->t_iflag & IGNBRK))) {
|
|
||||||
ioptr[0] = recv_data;
|
|
||||||
ioptr[CE_INPUT_OFFSET] = line_status;
|
|
||||||
com->iptr = ++ioptr;
|
|
||||||
}
|
|
||||||
if (ioptr == com->ihighwater
|
if (ioptr == com->ihighwater
|
||||||
&& com->state & CS_RTS_IFLOW)
|
&& com->state & CS_RTS_IFLOW)
|
||||||
outb(com->modem_ctl_port,
|
outb(com->modem_ctl_port,
|
||||||
com->mcr_image &= ~MCR_RTS);
|
com->mcr_image &= ~MCR_RTS);
|
||||||
/* XXX - move this out of isr */
|
|
||||||
if (line_status & LSR_OE)
|
|
||||||
CE_RECORD(com, CE_OVERRUN);
|
|
||||||
}
|
}
|
||||||
|
cont:
|
||||||
/*
|
/*
|
||||||
* "& 0x7F" is to avoid the gcc-1.40 generating a slow
|
* "& 0x7F" is to avoid the gcc-1.40 generating a slow
|
||||||
* jump from the top of the loop to here
|
* jump from the top of the loop to here
|
||||||
|
@ -1525,10 +1526,7 @@ siopoll()
|
||||||
}
|
}
|
||||||
if (com->state & CS_ODONE) {
|
if (com->state & CS_ODONE) {
|
||||||
comflush(com);
|
comflush(com);
|
||||||
if (linesw[tp->t_line].l_start != ttstart)
|
(*linesw[tp->t_line].l_start)(tp);
|
||||||
(*linesw[tp->t_line].l_start)(tp);
|
|
||||||
else
|
|
||||||
comstart(tp);
|
|
||||||
}
|
}
|
||||||
if (incc <= 0 || !(tp->t_state & TS_ISOPEN))
|
if (incc <= 0 || !(tp->t_state & TS_ISOPEN))
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue