From 4c891e15d435789959b0ac034bc476bb77bde51e Mon Sep 17 00:00:00 2001 From: pjanzen Date: Tue, 11 Apr 2000 02:44:12 +0000 Subject: [PATCH] Check usec for >= 1000000, not just > ; as msaitoh@NetBSD.org --- sys/arch/alpha/alpha/machdep.c | 6 +++--- sys/arch/amiga/amiga/machdep.c | 6 +++--- sys/arch/arc/arc/machdep.c | 8 ++++---- sys/arch/arm32/arm32/clock.c | 4 ++-- sys/arch/atari/atari/machdep.c | 4 ++-- sys/arch/i386/i386/machdep.c | 4 ++-- sys/arch/kbus/kbus/machdep.c | 2 +- sys/arch/mac68k/mac68k/machdep.c | 6 +++--- sys/arch/mvme68k/dev/nvram.c | 6 +++--- sys/arch/mvme88k/dev/nvram.c | 6 +++--- sys/arch/pc532/pc532/machdep.c | 2 +- sys/arch/powerpc/powerpc/clock.c | 4 ++-- sys/arch/sun3/sun3/clock.c | 6 +++--- sys/arch/vax/vax/clock.c | 6 +++--- sys/arch/wgrisc/wgrisc/machdep.c | 8 ++++---- sys/dev/sequencer.c | 4 ++-- 16 files changed, 41 insertions(+), 41 deletions(-) diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index 1cb6f85bb26..0403b5600a1 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.32 2000/03/23 09:59:52 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.33 2000/04/11 02:44:12 pjanzen Exp $ */ /* $NetBSD: machdep.c,v 1.61 1996/12/07 01:54:49 cgd Exp $ */ /* @@ -1618,14 +1618,14 @@ microtime(tvp) *tvp = time; #ifdef notdef tvp->tv_usec += clkread(); - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } #endif if (tvp->tv_sec == lasttime.tv_sec && tvp->tv_usec <= lasttime.tv_usec && - (tvp->tv_usec = lasttime.tv_usec + 1) > 1000000) { + (tvp->tv_usec = lasttime.tv_usec + 1) >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } diff --git a/sys/arch/amiga/amiga/machdep.c b/sys/arch/amiga/amiga/machdep.c index b8a3b324583..658285b5672 100644 --- a/sys/arch/amiga/amiga/machdep.c +++ b/sys/arch/amiga/amiga/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.37 2000/03/23 09:59:53 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.38 2000/04/11 02:44:23 pjanzen Exp $ */ /* $NetBSD: machdep.c,v 1.95 1997/08/27 18:31:17 is Exp $ */ /* @@ -989,13 +989,13 @@ microtime(tvp) *tvp = time; tvp->tv_usec += clkread(); - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } if (tvp->tv_sec == lasttime.tv_sec && tvp->tv_usec <= lasttime.tv_usec && - (tvp->tv_usec = lasttime.tv_usec + 1) > 1000000) { + (tvp->tv_usec = lasttime.tv_usec + 1) >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } diff --git a/sys/arch/arc/arc/machdep.c b/sys/arch/arc/arc/machdep.c index a9115abc7b5..e1d917ee00d 100644 --- a/sys/arch/arc/arc/machdep.c +++ b/sys/arch/arc/arc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.37 2000/03/23 09:59:53 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.38 2000/04/11 02:44:25 pjanzen Exp $ */ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1992, 1993 @@ -38,7 +38,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 8.3 (Berkeley) 1/12/94 - * $Id: machdep.c,v 1.37 2000/03/23 09:59:53 art Exp $ + * $Id: machdep.c,v 1.38 2000/04/11 02:44:25 pjanzen Exp $ */ /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ @@ -1261,14 +1261,14 @@ microtime(tvp) *tvp = time; #ifdef notdef tvp->tv_usec += clkread(); - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } #endif if (tvp->tv_sec == lasttime.tv_sec && tvp->tv_usec <= lasttime.tv_usec && - (tvp->tv_usec = lasttime.tv_usec + 1) > 1000000) { + (tvp->tv_usec = lasttime.tv_usec + 1) >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } diff --git a/sys/arch/arm32/arm32/clock.c b/sys/arch/arm32/arm32/clock.c index 6781d24fafe..41d70681f00 100644 --- a/sys/arch/arm32/arm32/clock.c +++ b/sys/arch/arm32/arm32/clock.c @@ -210,7 +210,7 @@ microtime(tvp) /* Make sure the micro seconds don't overflow. */ - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_usec -= 1000000; ++tvp->tv_sec; } @@ -220,7 +220,7 @@ microtime(tvp) if (tvp->tv_sec == oldtv.tv_sec && tvp->tv_usec <= oldtv.tv_usec) { tvp->tv_usec = oldtv.tv_usec + 1; - if (tvp->tv_usec > 1000000) { + if (tvp->tv_usec >= 1000000) { tvp->tv_usec -= 1000000; ++tvp->tv_sec; } diff --git a/sys/arch/atari/atari/machdep.c b/sys/arch/atari/atari/machdep.c index fce889d2bf7..16a72e1638d 100644 --- a/sys/arch/atari/atari/machdep.c +++ b/sys/arch/atari/atari/machdep.c @@ -1016,13 +1016,13 @@ void microtime(tvp) *tvp = time; tvp->tv_usec += clkread(); - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } if (tvp->tv_sec == lasttime.tv_sec && tvp->tv_usec <= lasttime.tv_usec && - (tvp->tv_usec = lasttime.tv_usec + 1) > 1000000) { + (tvp->tv_usec = lasttime.tv_usec + 1) >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 6dc18b614a0..a763a949c88 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.129 2000/04/08 05:50:50 aaron Exp $ */ +/* $OpenBSD: machdep.c,v 1.130 2000/04/11 02:44:27 pjanzen Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -1729,7 +1729,7 @@ microtime(tvp) *tvp = time; tvp->tv_usec += tick; splx(s); - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } diff --git a/sys/arch/kbus/kbus/machdep.c b/sys/arch/kbus/kbus/machdep.c index 390f9e83f79..5b1eeae34fa 100644 --- a/sys/arch/kbus/kbus/machdep.c +++ b/sys/arch/kbus/kbus/machdep.c @@ -573,7 +573,7 @@ microtime(tvp) *tvp = time; tvp->tv_usec += tick; - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c index 9fb3112faf4..d002aee2cef 100644 --- a/sys/arch/mac68k/mac68k/machdep.c +++ b/sys/arch/mac68k/mac68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.66 2000/03/23 09:59:54 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.67 2000/04/11 02:44:28 pjanzen Exp $ */ /* $NetBSD: machdep.c,v 1.134 1997/02/14 06:15:30 scottr Exp $ */ /* @@ -898,13 +898,13 @@ microtime(tvp) *tvp = time; tvp->tv_usec += clkread(); - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } if (tvp->tv_sec == lasttime.tv_sec && tvp->tv_usec <= lasttime.tv_usec && - (tvp->tv_usec = lasttime.tv_usec + 1) > 1000000) { + (tvp->tv_usec = lasttime.tv_usec + 1) >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } diff --git a/sys/arch/mvme68k/dev/nvram.c b/sys/arch/mvme68k/dev/nvram.c index 0559a963eb6..95fb75eb3df 100644 --- a/sys/arch/mvme68k/dev/nvram.c +++ b/sys/arch/mvme68k/dev/nvram.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nvram.c,v 1.5 1999/01/11 05:11:38 millert Exp $ */ +/* $OpenBSD: nvram.c,v 1.6 2000/04/11 02:44:29 pjanzen Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -123,13 +123,13 @@ microtime(tvp) *tvp = time; tvp->tv_usec; - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } if (tvp->tv_sec == lasttime.tv_sec && tvp->tv_usec <= lasttime.tv_usec && - (tvp->tv_usec = lasttime.tv_usec + 1) > 1000000) { + (tvp->tv_usec = lasttime.tv_usec + 1) >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } diff --git a/sys/arch/mvme88k/dev/nvram.c b/sys/arch/mvme88k/dev/nvram.c index 94576ccfad5..2444cda22e3 100644 --- a/sys/arch/mvme88k/dev/nvram.c +++ b/sys/arch/mvme88k/dev/nvram.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nvram.c,v 1.5 1999/09/27 18:43:24 smurph Exp $ */ +/* $OpenBSD: nvram.c,v 1.6 2000/04/11 02:44:29 pjanzen Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -150,13 +150,13 @@ microtime(tvp) *tvp = time; tvp->tv_usec; - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } if (tvp->tv_sec == lasttime.tv_sec && tvp->tv_usec <= lasttime.tv_usec && - (tvp->tv_usec = lasttime.tv_usec + 1) > 1000000) { + (tvp->tv_usec = lasttime.tv_usec + 1) >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } diff --git a/sys/arch/pc532/pc532/machdep.c b/sys/arch/pc532/pc532/machdep.c index eb26828fb67..01f0a3daf73 100644 --- a/sys/arch/pc532/pc532/machdep.c +++ b/sys/arch/pc532/pc532/machdep.c @@ -714,7 +714,7 @@ microtime(tvp) *tvp = time; tvp->tv_usec += tick; - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } diff --git a/sys/arch/powerpc/powerpc/clock.c b/sys/arch/powerpc/powerpc/clock.c index a447e764dc4..9db0451c3e3 100644 --- a/sys/arch/powerpc/powerpc/clock.c +++ b/sys/arch/powerpc/powerpc/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.7 2000/03/31 04:14:18 rahnds Exp $ */ +/* $OpenBSD: clock.c,v 1.8 2000/04/11 02:44:30 pjanzen Exp $ */ /* $NetBSD: clock.c,v 1.1 1996/09/30 16:34:40 ws Exp $ */ /* @@ -305,7 +305,7 @@ microtime(tvp) asm volatile ("mtmsr %0" :: "r"(msr)); ticks /= 1000; tvp->tv_usec += ticks; - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_usec -= 1000000; tvp->tv_sec++; } diff --git a/sys/arch/sun3/sun3/clock.c b/sys/arch/sun3/sun3/clock.c index f9bd5d07303..6e4abf5879a 100644 --- a/sys/arch/sun3/sun3/clock.c +++ b/sys/arch/sun3/sun3/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.7 1997/01/16 04:04:14 kstailey Exp $ */ +/* $OpenBSD: clock.c,v 1.8 2000/04/11 02:44:31 pjanzen Exp $ */ /* $NetBSD: clock.c,v 1.31 1996/10/30 00:24:42 gwr Exp $ */ /* @@ -302,13 +302,13 @@ microtime(tvp) *tvp = time; tvp->tv_usec++; /* XXX */ - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } if (tvp->tv_sec == lasttime.tv_sec && tvp->tv_usec <= lasttime.tv_usec && - (tvp->tv_usec = lasttime.tv_usec + 1) > 1000000) + (tvp->tv_usec = lasttime.tv_usec + 1) >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; diff --git a/sys/arch/vax/vax/clock.c b/sys/arch/vax/vax/clock.c index bb951c61830..20e382a6055 100644 --- a/sys/arch/vax/vax/clock.c +++ b/sys/arch/vax/vax/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.8 1997/09/10 12:04:42 maja Exp $ */ +/* $OpenBSD: clock.c,v 1.9 2000/04/11 02:44:32 pjanzen Exp $ */ /* $NetBSD: clock.c,v 1.20 1997/04/18 18:49:37 ragge Exp $ */ /* * Copyright (c) 1995 Ludd, University of Lule}, Sweden. @@ -69,13 +69,13 @@ microtime(tvp) i = mfpr(PR_ICR) + tick; /* Get current interval count */ tvp->tv_usec += i; - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } if (tvp->tv_sec == lasttime.tv_sec && tvp->tv_usec <= lasttime.tv_usec && - (tvp->tv_usec = lasttime.tv_usec + 1) > 1000000) { + (tvp->tv_usec = lasttime.tv_usec + 1) >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } diff --git a/sys/arch/wgrisc/wgrisc/machdep.c b/sys/arch/wgrisc/wgrisc/machdep.c index 38f61f10fe8..355f6cb4f25 100644 --- a/sys/arch/wgrisc/wgrisc/machdep.c +++ b/sys/arch/wgrisc/wgrisc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.6 2000/03/23 09:59:56 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.7 2000/04/11 02:44:32 pjanzen Exp $ */ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1992, 1993 @@ -38,7 +38,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 8.3 (Berkeley) 1/12/94 - * $Id: machdep.c,v 1.6 2000/03/23 09:59:56 art Exp $ + * $Id: machdep.c,v 1.7 2000/04/11 02:44:32 pjanzen Exp $ */ /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ @@ -1008,14 +1008,14 @@ microtime(tvp) *tvp = time; #ifdef notdef tvp->tv_usec += clkread(); - while (tvp->tv_usec > 1000000) { + while (tvp->tv_usec >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } #endif if (tvp->tv_sec == lasttime.tv_sec && tvp->tv_usec <= lasttime.tv_usec && - (tvp->tv_usec = lasttime.tv_usec + 1) > 1000000) { + (tvp->tv_usec = lasttime.tv_usec + 1) >= 1000000) { tvp->tv_sec++; tvp->tv_usec -= 1000000; } diff --git a/sys/dev/sequencer.c b/sys/dev/sequencer.c index 2db4eff0eb2..534673c21a9 100644 --- a/sys/dev/sequencer.c +++ b/sys/dev/sequencer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sequencer.c,v 1.2 1999/07/23 13:18:04 niklas Exp $ */ +/* $OpenBSD: sequencer.c,v 1.3 2000/04/11 02:44:33 pjanzen Exp $ */ /* $NetBSD: sequencer.c,v 1.13 1998/11/25 22:17:07 augustss Exp $ */ /* @@ -68,7 +68,7 @@ #define ADDTIMEVAL(a, b) ( \ (a)->tv_sec += (b)->tv_sec, \ (a)->tv_usec += (b)->tv_usec, \ - (a)->tv_usec > 1000000 ? ((a)->tv_sec++, (a)->tv_usec -= 1000000) : 0\ + (a)->tv_usec >= 1000000 ? ((a)->tv_sec++, (a)->tv_usec -= 1000000) : 0\ ) #define SUBTIMEVAL(a, b) ( \ -- 2.20.1