diff options
author | bde <bde@FreeBSD.org> | 1996-06-08 11:55:32 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-06-08 11:55:32 +0000 |
commit | ff0a22e64172eea59b39c7a003211eb4c12087b8 (patch) | |
tree | 91e9175c5bcb7a782fa4b2a68a2dc36e4b242d1f /sys/kern | |
parent | a2c3393c3cac3bbd922db2d009416c996338352d (diff) | |
download | FreeBSD-src-ff0a22e64172eea59b39c7a003211eb4c12087b8.zip FreeBSD-src-ff0a22e64172eea59b39c7a003211eb4c12087b8.tar.gz |
Updated some comments in settimeofday().
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_time.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 248d24c..07c1801 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_time.c 8.1 (Berkeley) 6/10/93 - * $Id: kern_time.c,v 1.14 1995/12/26 01:07:20 bde Exp $ + * $Id: kern_time.c,v 1.15 1996/04/07 17:38:57 bde Exp $ */ #include <sys/param.h> @@ -116,10 +116,22 @@ settimeofday(p, uap, retval) if (uap->tv) { /* WHAT DO WE DO ABOUT PENDING REAL-TIME TIMEOUTS??? */ s = splclock(); - /* nb. delta.tv_usec may be < 0, but this is OK here */ + /* + * Calculate delta directly to minimize clock interrupt + * latency. Fix it after the ipl has been lowered. + */ delta.tv_sec = atv.tv_sec - time.tv_sec; delta.tv_usec = atv.tv_usec - time.tv_usec; - time = atv; /* XXX should avoid skew in tv_usec */ + time = atv; + /* + * XXX should arrange for microtime() to agree with atv if + * it is called now. As it is, it may add up to about + * `tick' unwanted usec. + * Another problem is that clock interrupts may occur at + * other than multiples of `tick'. It's not worth fixing + * this here, since the problem is also caused by tick + * adjustments. + */ (void) splsoftclock(); timevalfix(&delta); timevaladd(&boottime, &delta); |