summaryrefslogtreecommitdiff
path: root/sys/kern/kern_tc.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2002-03-28 16:02:44 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2002-03-28 16:02:44 +0000
commit45609bea175fed9529ffe3e4a02aa0a51118522b (patch)
treed387a47dde5dc1fc6e7002c34b27b16d38144d48 /sys/kern/kern_tc.c
parent079f9ac4c7b98c6a1288688e41598f79bd57d3fb (diff)
Notes
Diffstat (limited to 'sys/kern/kern_tc.c')
-rw-r--r--sys/kern/kern_tc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
index 85900bd17998..e058e74151d4 100644
--- a/sys/kern/kern_tc.c
+++ b/sys/kern/kern_tc.c
@@ -238,10 +238,11 @@ tco_setscales(struct timecounter *tc)
/*
* We get nanoseconds with 32 bit binary fraction and want
* 64 bit binary fraction: x = a * 2^32 / 10^9 = a * 4.294967296
- * The range is +/- 500PPM so we can multiply by about 8500
- * without overflowing. 4398/1024 = is very close to ideal.
+ * The range is +/- 500PPM so we can only multiply by about 8500
+ * without overflowing. The best suitable fraction is 4398/1024.
+ * Divide by 2 times 1024 to match the temporary lower precision.
*/
- scale += (tc->tc_adjustment * 4398) >> 10;
+ scale += (tc->tc_adjustment * 4398) / 2048;
scale /= tc->tc_tweak->tc_frequency;
tc->tc_scale = scale * 2;
}