diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-07-02 17:27:02 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-07-02 17:27:02 +0000 |
commit | 3e0af5ec85e0fe2f9cb51541466d2567ea534a8f (patch) | |
tree | 98ea4006ae16bfe6a1b3730074d23b083948b395 /sys/arch/hp300/dev | |
parent | 4d2486b3dbf3e9ae0c6d38b616a80feed0b5e05a (diff) |
Move common code for waking up writers on a tty into a function.
ok deraadt matthew millert
Diffstat (limited to 'sys/arch/hp300/dev')
-rw-r--r-- | sys/arch/hp300/dev/apci.c | 14 | ||||
-rw-r--r-- | sys/arch/hp300/dev/dca.c | 14 | ||||
-rw-r--r-- | sys/arch/hp300/dev/dcm.c | 10 |
3 files changed, 10 insertions, 28 deletions
diff --git a/sys/arch/hp300/dev/apci.c b/sys/arch/hp300/dev/apci.c index 4e5b9ad65ba..6bc333b4f4d 100644 --- a/sys/arch/hp300/dev/apci.c +++ b/sys/arch/hp300/dev/apci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apci.c,v 1.40 2010/06/30 18:10:47 miod Exp $ */ +/* $OpenBSD: apci.c,v 1.41 2010/07/02 17:27:01 nicm Exp $ */ /* $NetBSD: apci.c,v 1.9 2000/11/02 00:35:05 eeh Exp $ */ /*- @@ -762,15 +762,9 @@ apcistart(tp) if (tp->t_state & (TS_TIMEOUT|TS_TTSTOP)) goto out; - if (tp->t_outq.c_cc <= tp->t_lowat) { - if (tp->t_state & TS_ASLEEP) { - tp->t_state &= ~TS_ASLEEP; - wakeup((caddr_t)&tp->t_outq); - } - selwakeup(&tp->t_wsel); - if (tp->t_outq.c_cc == 0) - goto out; - } + ttwakeupwr(tp); + if (tp->t_outq.c_cc == 0) + goto out; if (apci->ap_lsr & LSR_TXRDY) { tp->t_state |= TS_BUSY; if (sc->sc_flags & APCI_HASFIFO) { diff --git a/sys/arch/hp300/dev/dca.c b/sys/arch/hp300/dev/dca.c index 2083b880b70..ef2c0a306da 100644 --- a/sys/arch/hp300/dev/dca.c +++ b/sys/arch/hp300/dev/dca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dca.c,v 1.41 2010/06/30 18:10:47 miod Exp $ */ +/* $OpenBSD: dca.c,v 1.42 2010/07/02 17:27:01 nicm Exp $ */ /* $NetBSD: dca.c,v 1.35 1997/05/05 20:58:18 thorpej Exp $ */ /* @@ -861,15 +861,9 @@ dcastart(tp) if (tp->t_state & (TS_TIMEOUT|TS_TTSTOP)) goto out; - if (tp->t_outq.c_cc <= tp->t_lowat) { - if (tp->t_state & TS_ASLEEP) { - tp->t_state &= ~TS_ASLEEP; - wakeup((caddr_t)&tp->t_outq); - } - selwakeup(&tp->t_wsel); - if (tp->t_outq.c_cc == 0) - goto out; - } + ttwakeupwr(tp); + if (tp->t_outq.c_cc == 0) + goto out; if (dca->dca_lsr & LSR_TXRDY) { tp->t_state |= TS_BUSY; if (sc->sc_flags & DCA_HASFIFO) { diff --git a/sys/arch/hp300/dev/dcm.c b/sys/arch/hp300/dev/dcm.c index 9691f312a2f..3e329fc8ac5 100644 --- a/sys/arch/hp300/dev/dcm.c +++ b/sys/arch/hp300/dev/dcm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dcm.c,v 1.34 2010/06/28 14:13:27 deraadt Exp $ */ +/* $OpenBSD: dcm.c,v 1.35 2010/07/02 17:27:01 nicm Exp $ */ /* $NetBSD: dcm.c,v 1.41 1997/05/05 20:59:16 thorpej Exp $ */ /* @@ -1171,13 +1171,7 @@ dcmstart(tp) #endif if (tp->t_state & (TS_TIMEOUT|TS_BUSY|TS_TTSTOP)) goto out; - if (tp->t_outq.c_cc <= tp->t_lowat) { - if (tp->t_state&TS_ASLEEP) { - tp->t_state &= ~TS_ASLEEP; - wakeup((caddr_t)&tp->t_outq); - } - selwakeup(&tp->t_wsel); - } + ttwakeupwr(tp); if (tp->t_outq.c_cc == 0) { #ifdef DCMSTATS dsp->xempty++; |