From df471779ea30010cad783a1cf0c754ea128ab0e3 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sun, 21 Jun 1998 12:22:35 +0000 Subject: Round tickadj up. This prevents tickadj from being 0 when HZ > 500, which makes adjtime(2) useless and confuses xntpd(8) into refusing to start even when it would use the kernel PLL instead of adjtime(). The result is the same as recommended by tickadj(8), at least when HZ divides 10^6. Of course, you wouldn't want to actually use adjtime() when HZ is large. In the silly boundary case of HZ == 10^6, tickadj == tick == 1 so the clock stops while adjtime() is active. --- sys/conf/param.c | 4 ++-- sys/kern/subr_param.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sys') diff --git a/sys/conf/param.c b/sys/conf/param.c index b78a29273e40..00d2484caf02 100644 --- a/sys/conf/param.c +++ b/sys/conf/param.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)param.c 8.3 (Berkeley) 8/20/94 - * $Id: param.c,v 1.26 1998/02/27 19:58:29 guido Exp $ + * $Id: param.c,v 1.27 1998/05/15 20:10:54 wollman Exp $ */ #include "opt_sysvipc.h" @@ -70,7 +70,7 @@ #endif int hz = HZ; int tick = 1000000 / HZ; -int tickadj = 30000 / (60 * HZ); /* can adjust 30ms in 60s */ +int tickadj = howmany(30000, 60 * HZ); /* can adjust 30ms in 60s */ #define NPROC (20 + 16 * MAXUSERS) #define MAXFILES (NPROC*2) int maxproc = NPROC; /* maximum # of processes */ diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index b78a29273e40..00d2484caf02 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)param.c 8.3 (Berkeley) 8/20/94 - * $Id: param.c,v 1.26 1998/02/27 19:58:29 guido Exp $ + * $Id: param.c,v 1.27 1998/05/15 20:10:54 wollman Exp $ */ #include "opt_sysvipc.h" @@ -70,7 +70,7 @@ #endif int hz = HZ; int tick = 1000000 / HZ; -int tickadj = 30000 / (60 * HZ); /* can adjust 30ms in 60s */ +int tickadj = howmany(30000, 60 * HZ); /* can adjust 30ms in 60s */ #define NPROC (20 + 16 * MAXUSERS) #define MAXFILES (NPROC*2) int maxproc = NPROC; /* maximum # of processes */ -- cgit v1.3