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/mvme68k | |
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/mvme68k')
-rw-r--r-- | sys/arch/mvme68k/dev/dart.c | 14 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/zs.c | 18 |
2 files changed, 7 insertions, 25 deletions
diff --git a/sys/arch/mvme68k/dev/dart.c b/sys/arch/mvme68k/dev/dart.c index 9c2abb5a137..d1e30fcf547 100644 --- a/sys/arch/mvme68k/dev/dart.c +++ b/sys/arch/mvme68k/dev/dart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dart.c,v 1.7 2010/06/28 14:13:29 deraadt Exp $ */ +/* $OpenBSD: dart.c,v 1.8 2010/07/02 17:27:01 nicm Exp $ */ /* * Mach Operating System @@ -277,15 +277,9 @@ dartstart(struct tty *tp) if (tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP)) goto bail; - 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 bail; - } + ttwakeupwr(tp); + if (tp->t_outq.c_cc == 0) + goto bail; tp->t_state |= TS_BUSY; while (tp->t_outq.c_cc != 0) { diff --git a/sys/arch/mvme68k/dev/zs.c b/sys/arch/mvme68k/dev/zs.c index 801dbe43a76..71eb8708113 100644 --- a/sys/arch/mvme68k/dev/zs.c +++ b/sys/arch/mvme68k/dev/zs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zs.c,v 1.33 2010/06/28 14:13:29 deraadt Exp $ */ +/* $OpenBSD: zs.c,v 1.34 2010/07/02 17:27:01 nicm Exp $ */ /* * Copyright (c) 2000 Steve Murphree, Jr. @@ -557,13 +557,7 @@ zsstop(tp, flag) tp->t_state &= ~TS_BUSY; spltty(); ndflush(&tp->t_outq, n); - 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); } splx(s); return (0); @@ -905,13 +899,7 @@ zs_softint(arg) && (tp->t_state & TS_BUSY) != 0) { tp->t_state &= ~(TS_BUSY | TS_FLUSH); ndflush(&tp->t_outq, zp->sent_count); - 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_line != 0) (*linesw[tp->t_line].l_start) (tp); else |