summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/tty.c8
-rw-r--r--sys/sys/param.h8
-rw-r--r--sys/sys/tty.h4
3 files changed, 6 insertions, 14 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 906702d0285..45f7283658c 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.95 2012/04/22 02:26:11 matthew Exp $ */
+/* $OpenBSD: tty.c,v 1.96 2013/01/17 21:24:58 deraadt Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -2066,15 +2066,15 @@ ttspeedtab(int speed, const struct speedtab *table)
void
ttsetwater(struct tty *tp)
{
- int cps, x;
+ int cps, x, omost;
#define CLAMP(x, h, l) ((x) > h ? h : ((x) < l) ? l : (x))
cps = tp->t_ospeed / 10;
tp->t_lowat = x = CLAMP(cps / 2, TTMAXLOWAT, TTMINLOWAT);
x += cps;
- x = CLAMP(x, TTMAXHIWAT, TTMINHIWAT);
- tp->t_hiwat = roundup(x, CBSIZE);
+ omost = MIN(tp->t_outq.c_cn - 200, tp->t_outq.c_cn);
+ tp->t_hiwat = CLAMP(x, omost, 100);
#undef CLAMP
}
diff --git a/sys/sys/param.h b/sys/sys/param.h
index f3a399d05d3..89caed132aa 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.99 2013/01/16 10:38:27 deraadt Exp $ */
+/* $OpenBSD: param.h,v 1.100 2013/01/17 21:24:58 deraadt Exp $ */
/* $NetBSD: param.h,v 1.23 1996/03/17 01:02:29 thorpej Exp $ */
/*-
@@ -117,12 +117,6 @@
#define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */
#define NODEV (dev_t)(-1) /* non-existent device */
-#define CBLOCK 64 /* Clist block size, must be a power of 2. */
-#define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */
- /* Data chars/clist. */
-#define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE)
-#define CROUND (CBLOCK - 1) /* Clist rounding. */
-
/*
* Constants related to network buffer management.
* MCLBYTES must be no larger than NBPG (the software page size), and,
diff --git a/sys/sys/tty.h b/sys/sys/tty.h
index 5a5da3accf4..c8d5e378737 100644
--- a/sys/sys/tty.h
+++ b/sys/sys/tty.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.h,v 1.31 2011/07/04 22:53:53 tedu Exp $ */
+/* $OpenBSD: tty.h,v 1.32 2013/01/17 21:24:58 deraadt Exp $ */
/* $NetBSD: tty.h,v 1.30.4.1 1996/06/02 09:08:13 mrg Exp $ */
/*-
@@ -169,8 +169,6 @@ struct itty {
#define TTYHOG(tp) (tp)->t_qlen
#ifdef _KERNEL
-#define TTMAXHIWAT roundup(2048, CBSIZE)
-#define TTMINHIWAT roundup(100, CBSIZE)
#define TTMAXLOWAT 256
#define TTMINLOWAT 32
#endif