summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2010-11-28 18:59:52 +0000
committerColin Percival <cperciva@FreeBSD.org>2010-11-28 18:59:52 +0000
commitef77c3e961233044230cba2739c1fb2230e9527b (patch)
treee90938805d661c6b562398e0c5d9b7448c5b8013 /sys/kern
parentbfc4201b76915346b1717766a8ea5930b5c22839 (diff)
Notes
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_tc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
index b86113175315..c3619542f185 100644
--- a/sys/kern/kern_tc.c
+++ b/sys/kern/kern_tc.c
@@ -440,6 +440,16 @@ tc_windup(void)
ncount = 0;
th->th_offset_count += delta;
th->th_offset_count &= th->th_counter->tc_counter_mask;
+ while (delta > th->th_counter->tc_frequency) {
+ /* Eat complete unadjusted seconds. */
+ delta -= th->th_counter->tc_frequency;
+ th->th_offset.sec++;
+ }
+ if ((delta > th->th_counter->tc_frequency / 2) &&
+ (th->th_scale * delta < ((uint64_t)1 << 63))) {
+ /* The product th_scale * delta just barely overflows. */
+ th->th_offset.sec++;
+ }
bintime_addx(&th->th_offset, th->th_scale * delta);
/*