Change obsolete CBSIZE constant (48), to a power of two constant (64) that

is close enough to match the original assumptions.
This commit is contained in:
christos 2011-09-23 15:29:08 +00:00
parent 008d0db94d
commit 04f8076084
4 changed files with 13 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: tty.c,v 1.246 2011/07/26 13:14:18 yamt Exp $ */
/* $NetBSD: tty.c,v 1.247 2011/09/23 15:29:08 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -63,7 +63,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.246 2011/07/26 13:14:18 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.247 2011/09/23 15:29:08 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -2350,7 +2350,7 @@ ttsetwater(struct tty *tp)
tp->t_lowat = x = CLAMP(cps / 2, TTMAXLOWAT, TTMINLOWAT);
x += cps;
x = CLAMP(x, TTMAXHIWAT, TTMINHIWAT);
tp->t_hiwat = roundup(x, CBSIZE);
tp->t_hiwat = roundup(x, TTROUND);
#undef CLAMP
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_sl.c,v 1.117 2010/04/05 07:22:23 joerg Exp $ */
/* $NetBSD: if_sl.c,v 1.118 2011/09/23 15:29:09 christos Exp $ */
/*
* Copyright (c) 1987, 1989, 1992, 1993
@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.117 2010/04/05 07:22:23 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.118 2011/09/23 15:29:09 christos Exp $");
#include "opt_inet.h"
@ -154,7 +154,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.117 2010/04/05 07:22:23 joerg Exp $");
#if (SLMTU < 3)
#error SLMTU way too small.
#endif
#define SLIP_HIWAT roundup(50,CBSIZE)
#define SLIP_HIWAT roundup(50, TTROUND)
#ifndef __NetBSD__ /* XXX - cgd */
#define CLISTRESERVE 1024 /* Can't let clists get too low */
#endif /* !__NetBSD__ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_strip.c,v 1.95 2010/04/05 07:22:24 joerg Exp $ */
/* $NetBSD: if_strip.c,v 1.96 2011/09/23 15:29:09 christos Exp $ */
/* from: NetBSD: if_sl.c,v 1.38 1996/02/13 22:00:23 christos Exp $ */
/*
@ -87,7 +87,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_strip.c,v 1.95 2010/04/05 07:22:24 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_strip.c,v 1.96 2011/09/23 15:29:09 christos Exp $");
#include "opt_inet.h"
@ -186,7 +186,7 @@ typedef char ttychar_t;
#define STRIP_MTU_ONWIRE (SLMTU + 20 + STRIP_HDRLEN) /* (2*SLMTU+2 in sl.c */
#define SLIP_HIWAT roundup(50,CBSIZE)
#define SLIP_HIWAT roundup(50, TTROUND)
/* This is a NetBSD-1.0 or later kernel. */
#define CCOUNT(q) ((q)->c_cc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: tty.h,v 1.88 2011/07/26 13:14:17 yamt Exp $ */
/* $NetBSD: tty.h,v 1.89 2011/09/23 15:29:09 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -165,10 +165,11 @@ struct tty {
#define TTYHOG 1024
#ifdef _KERNEL
#define TTMAXHIWAT roundup(2048, CBSIZE)
#define TTMINHIWAT roundup(100, CBSIZE)
#define TTMAXHIWAT roundup(2048, TTROUND)
#define TTMINHIWAT roundup(100, TTROUND)
#define TTMAXLOWAT 256
#define TTMINLOWAT 32
#define TTROUND 64
#endif /* _KERNEL */
/* These flags are kept in t_state. */