summaryrefslogtreecommitdiffstats
path: root/sys/dev/cy
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-07-22 01:30:45 +0000
committerbde <bde@FreeBSD.org>1995-07-22 01:30:45 +0000
commit688f94b1434ed320dfa1c4a16c80bac5f308daf5 (patch)
treec4afe09d343e52acfa2524ee2edbd4e49000cf11 /sys/dev/cy
parent94cb7648d61aaab09b106f4dfb5fcd1e8c6c3cfc (diff)
downloadFreeBSD-src-688f94b1434ed320dfa1c4a16c80bac5f308daf5.zip
FreeBSD-src-688f94b1434ed320dfa1c4a16c80bac5f308daf5.tar.gz
Move the inline code for waking up writers to a new function
ttwwakeup(). The conditions for doing the wakeup will soon become more complicated and I don't want them duplicated in all drivers. It's probably not worth making ttwwakeup() a macro or an inline function. The cost of the function call is relatively small when there is a process to wake up. There is usually a process to wake up for large writes and the system call overhead dwarfs the function call overhead for small writes.
Diffstat (limited to 'sys/dev/cy')
-rw-r--r--sys/dev/cy/cy.c19
-rw-r--r--sys/dev/cy/cy_isa.c19
2 files changed, 4 insertions, 34 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index 090901f..338abb1 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.8 1995/07/05 12:15:52 bde Exp $
+ * $Id: cy.c,v 1.9 1995/07/21 22:51:31 bde Exp $
*/
#include "cy.h"
@@ -155,8 +155,6 @@
* XXX temporary kludges for 2.0 (XXX TK2.0).
*/
#define TSA_CARR_ON(tp) ((void *)&(tp)->t_rawq)
-#define TSA_OCOMPLETE(tp) ((void *)&(tp)->t_outq)
-#define TSA_OLOWAT(tp) ((void *)&(tp)->t_outq)
#define LOTS_OF_EVENTS 64 /* helps separate urgent events from input */
#define RB_I_HIGH_WATER (TTYHOG - 2 * RS_IBUFSIZE)
@@ -2137,20 +2135,7 @@ comstart(tp)
siointr1(com); /* fake interrupt to start output */
enable_intr();
#endif
-
-#if 0 /* XXX TK2.0 */
- if (tp->t_state & (TS_SO_OCOMPLETE | TS_SO_OLOWAT) || tp->t_wsel)
- ttwwakeup(tp);
-#else
- if (tp->t_outq.c_cc <= tp->t_lowat) {
- if (tp->t_state & TS_ASLEEP) {
- tp->t_state &= ~TS_ASLEEP;
- wakeup(TSA_OLOWAT(tp));
- }
- selwakeup(&tp->t_wsel);
- }
-#endif
-
+ ttwwakeup(tp);
splx(s);
}
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index 090901f..338abb1 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.8 1995/07/05 12:15:52 bde Exp $
+ * $Id: cy.c,v 1.9 1995/07/21 22:51:31 bde Exp $
*/
#include "cy.h"
@@ -155,8 +155,6 @@
* XXX temporary kludges for 2.0 (XXX TK2.0).
*/
#define TSA_CARR_ON(tp) ((void *)&(tp)->t_rawq)
-#define TSA_OCOMPLETE(tp) ((void *)&(tp)->t_outq)
-#define TSA_OLOWAT(tp) ((void *)&(tp)->t_outq)
#define LOTS_OF_EVENTS 64 /* helps separate urgent events from input */
#define RB_I_HIGH_WATER (TTYHOG - 2 * RS_IBUFSIZE)
@@ -2137,20 +2135,7 @@ comstart(tp)
siointr1(com); /* fake interrupt to start output */
enable_intr();
#endif
-
-#if 0 /* XXX TK2.0 */
- if (tp->t_state & (TS_SO_OCOMPLETE | TS_SO_OLOWAT) || tp->t_wsel)
- ttwwakeup(tp);
-#else
- if (tp->t_outq.c_cc <= tp->t_lowat) {
- if (tp->t_state & TS_ASLEEP) {
- tp->t_state &= ~TS_ASLEEP;
- wakeup(TSA_OLOWAT(tp));
- }
- selwakeup(&tp->t_wsel);
- }
-#endif
-
+ ttwwakeup(tp);
splx(s);
}
OpenPOWER on IntegriCloud