instead of afterward (if it's synchronous, we hang); call driver oproc
at normal priority, and let it check for timeout,etc (they all do anyway).
SCCS-vsn: sys/kern/tty.c 7.7
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)tty.c 7.6 (Berkeley) %G%
+ * @(#)tty.c 7.7 (Berkeley) %G%
*/
#include "../machine/reg.h"
*/
#include "../machine/reg.h"
ttstart(tp)
register struct tty *tp;
{
ttstart(tp)
register struct tty *tp;
{
- s = spltty();
- if ((tp->t_state & (TS_TIMEOUT|TS_TTSTOP|TS_BUSY)) == 0 &&
- tp->t_oproc) /* kludge for pty */
+ if (tp->t_oproc) /* kludge for pty */
* in acquiring new space.
*/
while (uio->uio_resid > 0) {
* in acquiring new space.
*/
while (uio->uio_resid > 0) {
+ if (tp->t_outq.c_cc > hiwat) {
+ cc = 0;
+ goto ovhiwat;
+ }
/*
* Grab a hunk of data from the user.
*/
/*
* Grab a hunk of data from the user.
*/
error = uiomove(cp, cc, UIO_WRITE, uio);
if (error)
break;
error = uiomove(cp, cc, UIO_WRITE, uio);
if (error)
break;
- if (tp->t_outq.c_cc > hiwat)
- goto ovhiwat;
if (tp->t_flags&FLUSHO)
continue;
/*
if (tp->t_flags&FLUSHO)
continue;
/*
if (cc != 0) {
uio->uio_iov->iov_base -= cc;
uio->uio_iov->iov_len += cc;
uio->uio_resid += cc;
uio->uio_offset -= cc;
}
if (cc != 0) {
uio->uio_iov->iov_base -= cc;
uio->uio_iov->iov_len += cc;
uio->uio_resid += cc;
uio->uio_offset -= cc;
}
+ ttstart(tp);
+ s = spltty();
- * This can only occur if FLUSHO
- * is also set in t_flags.
+ * This can only occur if FLUSHO is set in t_flags,
+ * or if ttstart/oproc is synchronous (or very fast).
*/
if (tp->t_outq.c_cc <= hiwat) {
splx(s);
goto loop;
}
*/
if (tp->t_outq.c_cc <= hiwat) {
splx(s);
goto loop;
}
if (tp->t_state&TS_NBIO) {
splx(s);
if (uio->uio_resid == cnt)
if (tp->t_state&TS_NBIO) {
splx(s);
if (uio->uio_resid == cnt)