Rearrange *param() slightly to eliminate a spl.

Also fix another comment regarding DTR.
This commit is contained in:
mycroft 1997-11-02 09:15:41 +00:00
parent 76b7dd52df
commit 5869b743c7
2 changed files with 30 additions and 34 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: com.c,v 1.123 1997/11/02 08:55:52 mycroft Exp $ */
/* $NetBSD: com.c,v 1.124 1997/11/02 09:15:41 mycroft Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995, 1996, 1997
@ -1079,12 +1079,23 @@ comparam(tp, t)
com_loadchannelregs(sc);
}
if (!ISSET(t->c_cflag, CHWFLOW)) {
if (ISSET(sc->sc_rx_flags, RX_TTY_OVERFLOWED)) {
CLR(sc->sc_rx_flags, RX_TTY_OVERFLOWED);
com_schedrx(sc);
}
if (ISSET(sc->sc_rx_flags, RX_TTY_BLOCKED|RX_IBUF_BLOCKED)) {
CLR(sc->sc_rx_flags, RX_TTY_BLOCKED|RX_IBUF_BLOCKED);
com_hwiflow(sc);
}
}
splx(s);
/*
* Update the tty layer's idea of the carrier bit, in case we changed
* CLOCAL or MDMBUF. We don't hang up here; we only do that if we
* lose carrier while carrier detection is on.
* CLOCAL or MDMBUF. We don't hang up here; we only do that by
* explicit request.
*/
(void) (*linesw[tp->t_line].l_modem)(tp, ISSET(sc->sc_msr, MSR_DCD));
@ -1095,25 +1106,10 @@ comparam(tp, t)
/* Block or unblock as needed. */
if (!ISSET(t->c_cflag, CHWFLOW)) {
s = splserial();
if (ISSET(sc->sc_rx_flags, RX_TTY_OVERFLOWED)) {
CLR(sc->sc_rx_flags, RX_TTY_OVERFLOWED);
com_schedrx(sc);
}
if (ISSET(sc->sc_rx_flags, RX_TTY_BLOCKED|RX_IBUF_BLOCKED)) {
CLR(sc->sc_rx_flags, RX_TTY_BLOCKED|RX_IBUF_BLOCKED);
com_hwiflow(sc);
}
splx(s);
if (sc->sc_tx_stopped) {
sc->sc_tx_stopped = 0;
comstart(tp);
}
} else {
/* XXXXX FIX ME */
#if 0
commsrint(sc, tp);
#endif
}
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: z8530tty.c,v 1.32 1997/11/02 08:55:53 mycroft Exp $ */
/* $NetBSD: z8530tty.c,v 1.33 1997/11/02 09:15:46 mycroft Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995, 1996, 1997
@ -916,27 +916,27 @@ zsparam(tp, t)
zs_loadchannelregs(cs);
}
splx(s);
/*
* Update the tty layer's idea of the carrier bit, in case we changed
* CLOCAL or MDMBUF. We don't hang up here; we only do that if we
* lose carrier while carrier detection is on.
*/
(void) (*line->l_modem)(tp, (cs->cs_rr0 & cs->cs_rr0_dcd) != 0);
/* If we can throttle input, enable "high water" detection. */
if (cflag & CHWFLOW) {
zst->zst_rbhiwat = zstty_rbuf_hiwat;
} else {
if ((cflag & CHWFLOW) == 0) {
/* This impossible value prevents a "high water" trigger. */
zst->zst_rbhiwat = zstty_rbuf_size;
s = splzs();
if (zst->zst_rx_blocked) {
zst->zst_rx_blocked = 0;
zs_hwiflow(zst);
}
splx(s);
} else {
zst->zst_rbhiwat = zstty_rbuf_hiwat;
}
splx(s);
/*
* Update the tty layer's idea of the carrier bit, in case we changed
* CLOCAL or MDMBUF. We don't hang up here; we only do that by
* explicit request.
*/
(void) (*line->l_modem)(tp, (cs->cs_rr0 & cs->cs_rr0_dcd) != 0);
if ((cflag & CHWFLOW) == 0) {
if (zst->zst_tx_stopped) {
zst->zst_tx_stopped = 0;
zsstart(tp);