Update to use timer{add,sub}().

This commit is contained in:
mycroft 1995-03-21 13:33:34 +00:00
parent 592f732f5a
commit f75ba16b09
26 changed files with 79 additions and 84 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sleep.c,v 1.7 1995/03/04 01:56:08 cgd Exp $ */ /* $NetBSD: sleep.c,v 1.8 1995/03/21 13:36:46 mycroft Exp $ */
/* /*
* Copyright (c) 1989, 1993 * Copyright (c) 1989, 1993
@ -37,7 +37,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)sleep.c 8.1 (Berkeley) 6/4/93"; static char sccsid[] = "@(#)sleep.c 8.1 (Berkeley) 6/4/93";
#else #else
static char rcsid[] = "$NetBSD: sleep.c,v 1.7 1995/03/04 01:56:08 cgd Exp $"; static char rcsid[] = "$NetBSD: sleep.c,v 1.8 1995/03/21 13:36:46 mycroft Exp $";
#endif #endif
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
@ -82,8 +82,7 @@ sleep(seconds)
* before ours, so we compute the time diff * before ours, so we compute the time diff
* so we can add it back in the end. * so we can add it back in the end.
*/ */
diff = itv.it_value; timersub(&itv.it_value, &oitv.it_value, &diff);
__timersub(&diff, &oitv.it_value);
itv.it_value = oitv.it_value; itv.it_value = oitv.it_value;
/* /*
* This is a hack, but we must have time to return * This is a hack, but we must have time to return
@ -106,7 +105,7 @@ sleep(seconds)
(void) setitimer(ITIMER_REAL, &oitv, &itv); (void) setitimer(ITIMER_REAL, &oitv, &itv);
if (timerisset(&diff)) if (timerisset(&diff))
__timeradd(&itv.it_value, &diff); timeradd(&itv.it_value, &diff, &itv.it_value);
return (itv.it_value.tv_sec); return (itv.it_value.tv_sec);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_break.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_break.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_misc.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc_notalpha.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_misc_notalpha.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldmmap.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_oldmmap.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldolduname.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_oldolduname.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldselect.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_oldselect.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_olduname.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_olduname.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_pipe.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_pipe.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_misc.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_break.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_break.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc_notalpha.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_misc_notalpha.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldmmap.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_oldmmap.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldolduname.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_oldolduname.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldselect.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_oldselect.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_olduname.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_olduname.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_pipe.c,v 1.2 1995/03/05 23:23:41 fvdl Exp $ */ /* $NetBSD: linux_pipe.c,v 1.3 1995/03/21 13:34:30 mycroft Exp $ */
/* /*
* Copyright (c) 1995 Frank van der Linden * Copyright (c) 1995 Frank van der Linden
@ -519,7 +519,7 @@ linux_alarm(p, uap, retval)
timerclear(&itp->it_interval); timerclear(&itp->it_interval);
if (timerisset(&itp->it_value) && if (timerisset(&itp->it_value) &&
timercmp(&itp->it_value, &time, >)) timercmp(&itp->it_value, &time, >))
__timersub(&itp->it_value, &time); timersub(&itp->it_value, &time, &itp->it_value);
/* /*
* Return how many seconds were left (rounded up) * Return how many seconds were left (rounded up)
*/ */
@ -548,7 +548,7 @@ linux_alarm(p, uap, retval)
} }
if (timerisset(&it.it_value)) { if (timerisset(&it.it_value)) {
__timeradd(&it.it_value, &time); timeradd(&it.it_value, &time, &it.it_value);
timeout(realitexpire, p, hzto(&it.it_value)); timeout(realitexpire, p, hzto(&it.it_value));
} }
p->p_realtimer = it; p->p_realtimer = it;

View File

@ -1,4 +1,4 @@
/* $NetBSD: osf1_misc.c,v 1.1 1995/02/13 21:39:06 cgd Exp $ */ /* $NetBSD: osf1_misc.c,v 1.2 1995/03/21 13:34:26 mycroft Exp $ */
/* /*
* Copyright (c) 1994, 1995 Carnegie-Mellon University. * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@ -246,9 +246,8 @@ osf1_usleep_thread(p, uap, retval)
if (SCARG(uap, slept) != NULL) { if (SCARG(uap, slept) != NULL) {
s = splclock(); s = splclock();
endtv = time; timersub(&time, &tv, &endtv);
splx(s); splx(s);
__timersub(&endtv, &tv);
if (tv.tv_sec < 0 || tv.tv_usec < 0) if (tv.tv_sec < 0 || tv.tv_usec < 0)
tv.tv_sec = tv.tv_usec = 0; tv.tv_sec = tv.tv_usec = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos_misc.c,v 1.42 1995/03/09 12:06:14 mycroft Exp $ */ /* $NetBSD: sunos_misc.c,v 1.43 1995/03/21 13:34:15 mycroft Exp $ */
/* /*
* Copyright (c) 1992, 1993 * Copyright (c) 1992, 1993
@ -969,7 +969,7 @@ sunos_poll(p, uap, retval)
goto done; goto done;
} }
s = splclock(); s = splclock();
__timeradd(&atv, &time); timeradd(&atv, &time, &atv);
timo = hzto(&atv); timo = hzto(&atv);
/* /*
* Avoid inadvertently sleeping forever. * Avoid inadvertently sleeping forever.

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_fcntl.c,v 1.7 1994/12/11 17:56:24 mycroft Exp $ */ /* $NetBSD: svr4_fcntl.c,v 1.8 1995/03/21 13:34:20 mycroft Exp $ */
/* /*
* Copyright (c) 1994 Christos Zoulas * Copyright (c) 1994 Christos Zoulas
@ -394,7 +394,7 @@ svr4_poll(p, uap, retval)
goto done; goto done;
} }
s = splclock(); s = splclock();
__timeradd(&atv, &time); timeradd(&atv, &time, &atv);
timo = hzto(&atv); timo = hzto(&atv);
/* /*
* Avoid inadvertently sleeping forever. * Avoid inadvertently sleeping forever.

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_acct.c,v 1.38 1994/12/24 15:07:22 cgd Exp $ */ /* $NetBSD: kern_acct.c,v 1.39 1995/03/21 13:33:46 mycroft Exp $ */
/*- /*-
* Copyright (c) 1994 Christopher G. Demetriou * Copyright (c) 1994 Christopher G. Demetriou
@ -183,15 +183,13 @@ acct_process(p)
/* (3) The elapsed time the commmand ran (and its starting time) */ /* (3) The elapsed time the commmand ran (and its starting time) */
acct.ac_btime = p->p_stats->p_start.tv_sec; acct.ac_btime = p->p_stats->p_start.tv_sec;
s = splclock(); s = splclock();
tmp = time; timersub(&time, &p->p_stats->p_start, &tmp);
splx(s); splx(s);
__timersub(&tmp, &p->p_stats->p_start);
acct.ac_etime = encode_comp_t(tmp.tv_sec, tmp.tv_usec); acct.ac_etime = encode_comp_t(tmp.tv_sec, tmp.tv_usec);
/* (4) The average amount of memory used */ /* (4) The average amount of memory used */
r = &p->p_stats->p_ru; r = &p->p_stats->p_ru;
tmp = ut; timeradd(&ut, &st, &tmp);
__timeradd(&tmp, &st);
t = tmp.tv_sec * hz + tmp.tv_usec / tick; t = tmp.tv_sec * hz + tmp.tv_usec / tick;
if (t) if (t)
acct.ac_mem = (r->ru_ixrss + r->ru_idrss + r->ru_isrss) / t; acct.ac_mem = (r->ru_ixrss + r->ru_idrss + r->ru_isrss) / t;

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_resource.c,v 1.26 1995/03/05 20:48:15 fvdl Exp $ */ /* $NetBSD: kern_resource.c,v 1.27 1995/03/21 13:33:51 mycroft Exp $ */
/*- /*-
* Copyright (c) 1982, 1986, 1991, 1993 * Copyright (c) 1982, 1986, 1991, 1993
@ -461,8 +461,8 @@ ruadd(ru, ru2)
register long *ip, *ip2; register long *ip, *ip2;
register int i; register int i;
__timeradd(&ru->ru_utime, &ru2->ru_utime); timeradd(&ru->ru_utime, &ru2->ru_utime, &ru->ru_utime);
__timeradd(&ru->ru_stime, &ru2->ru_stime); timeradd(&ru->ru_stime, &ru2->ru_stime, &ru->ru_stime);
if (ru->ru_maxrss < ru2->ru_maxrss) if (ru->ru_maxrss < ru2->ru_maxrss)
ru->ru_maxrss = ru2->ru_maxrss; ru->ru_maxrss = ru2->ru_maxrss;
ip = &ru->ru_first; ip2 = &ru2->ru_first; ip = &ru->ru_first; ip2 = &ru2->ru_first;

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_time.c,v 1.13 1994/12/13 22:19:45 mycroft Exp $ */ /* $NetBSD: kern_time.c,v 1.14 1995/03/21 13:33:41 mycroft Exp $ */
/* /*
* Copyright (c) 1982, 1986, 1989, 1993 * Copyright (c) 1982, 1986, 1989, 1993
@ -107,13 +107,12 @@ settimeofday(p, uap, retval)
return (error); return (error);
if (SCARG(uap, tv)) { if (SCARG(uap, tv)) {
/* WHAT DO WE DO ABOUT PENDING REAL-TIME TIMEOUTS??? */ /* WHAT DO WE DO ABOUT PENDING REAL-TIME TIMEOUTS??? */
delta = atv;
s = splclock(); s = splclock();
__timersub(&delta, &time); timersub(&atv, &time, &delta);
time = atv; time = atv;
(void) splsoftclock(); (void) splsoftclock();
__timeradd(&boottime, &delta); timeradd(&boottime, &delta, &boottime);
__timeradd(&runtime, &delta); timeradd(&runtime, &delta, &runtime);
# if defined(NFSCLIENT) || defined(NFSSERVER) # if defined(NFSCLIENT) || defined(NFSSERVER)
lease_updatetime(delta.tv_sec); lease_updatetime(delta.tv_sec);
# endif # endif
@ -235,7 +234,7 @@ getitimer(p, uap, retval)
if (timercmp(&aitv.it_value, &time, <)) if (timercmp(&aitv.it_value, &time, <))
timerclear(&aitv.it_value); timerclear(&aitv.it_value);
else else
__timersub(&aitv.it_value, &time); timersub(&aitv.it_value, &time, &aitv.it_value);
} else } else
aitv = p->p_stats->p_timer[SCARG(uap, which)]; aitv = p->p_stats->p_timer[SCARG(uap, which)];
splx(s); splx(s);
@ -275,7 +274,7 @@ setitimer(p, uap, retval)
if (SCARG(uap, which) == ITIMER_REAL) { if (SCARG(uap, which) == ITIMER_REAL) {
untimeout(realitexpire, p); untimeout(realitexpire, p);
if (timerisset(&aitv.it_value)) { if (timerisset(&aitv.it_value)) {
__timeradd(&aitv.it_value, &time); timeradd(&aitv.it_value, &time, &aitv.it_value);
timeout(realitexpire, p, hzto(&aitv.it_value)); timeout(realitexpire, p, hzto(&aitv.it_value));
} }
p->p_realtimer = aitv; p->p_realtimer = aitv;
@ -308,8 +307,8 @@ realitexpire(arg)
} }
for (;;) { for (;;) {
s = splclock(); s = splclock();
__timeradd(&p->p_realtimer.it_value, timeradd(&p->p_realtimer.it_value,
&p->p_realtimer.it_interval); &p->p_realtimer.it_interval, &p->p_realtimer.it_value);
if (timercmp(&p->p_realtimer.it_value, &time, >)) { if (timercmp(&p->p_realtimer.it_value, &time, >)) {
timeout(realitexpire, p, timeout(realitexpire, p,
hzto(&p->p_realtimer.it_value)); hzto(&p->p_realtimer.it_value));

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_generic.c,v 1.18 1994/12/11 18:06:13 mycroft Exp $ */ /* $NetBSD: sys_generic.c,v 1.19 1995/03/21 13:33:34 mycroft Exp $ */
/* /*
* Copyright (c) 1982, 1986, 1989, 1993 * Copyright (c) 1982, 1986, 1989, 1993
@ -543,7 +543,7 @@ select(p, uap, retval)
goto done; goto done;
} }
s = splclock(); s = splclock();
__timeradd(&atv, &time); timeradd(&atv, &time, &atv);
timo = hzto(&atv); timo = hzto(&atv);
/* /*
* Avoid inadvertently sleeping forever. * Avoid inadvertently sleeping forever.

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_sl.c,v 1.34 1995/03/08 02:57:05 cgd Exp $ */ /* $NetBSD: if_sl.c,v 1.35 1995/03/21 13:34:02 mycroft Exp $ */
/* /*
* Copyright (c) 1987, 1989, 1992, 1993 * Copyright (c) 1987, 1989, 1992, 1993
@ -407,10 +407,10 @@ sloutput(ifp, m, dst, rtp)
ifq = &sc->sc_fastq; ifq = &sc->sc_fastq;
s = splimp(); s = splimp();
if (sc->sc_oqlen && sc->sc_ttyp->t_outq.c_cc == sc->sc_oqlen) { if (sc->sc_oqlen && sc->sc_ttyp->t_outq.c_cc == sc->sc_oqlen) {
struct timeval tv = time; struct timeval tv;
/* if output's been stalled for too long, and restart */ /* if output's been stalled for too long, and restart */
__timersub(&tv, &sc->sc_if.if_lastchange); timersub(&time, &sc->sc_if.if_lastchange, &tv);
if (tv.tv_sec > 0) { if (tv.tv_sec > 0) {
sc->sc_otimeout++; sc->sc_otimeout++;
slstart(sc->sc_ttyp); slstart(sc->sc_ttyp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_syscalls.c,v 1.7 1994/12/14 13:03:48 mycroft Exp $ */ /* $NetBSD: lfs_syscalls.c,v 1.8 1995/03/21 13:34:08 mycroft Exp $ */
/*- /*-
* Copyright (c) 1991, 1993, 1994 * Copyright (c) 1991, 1993, 1994
@ -424,7 +424,7 @@ lfs_segwait(p, uap, retval)
if (itimerfix(&atv)) if (itimerfix(&atv))
return (EINVAL); return (EINVAL);
s = splclock(); s = splclock();
__timeradd(&atv, &time); timeradd(&atv, &time, &atv);
timeout = hzto(&atv); timeout = hzto(&atv);
splx(s); splx(s);
} else } else