diff options
Diffstat (limited to 'sys/kern/kern_tc.c')
-rw-r--r-- | sys/kern/kern_tc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index a911acc8f59..a9b853b0a14 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_tc.c,v 1.52 2019/12/02 02:24:29 cheloha Exp $ */ +/* $OpenBSD: kern_tc.c,v 1.53 2019/12/02 21:47:54 cheloha Exp $ */ /* * Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org> @@ -477,7 +477,6 @@ tc_windup(struct bintime *new_boottime, struct bintime *new_offset, struct bintime bt; struct timecounter *active_tc; struct timehands *th, *tho; - int64_t counter_adjustment; u_int64_t scale; u_int delta, ncount, ogen; int i; @@ -595,8 +594,7 @@ tc_windup(struct bintime *new_boottime, struct bintime *new_offset, * */ scale = (u_int64_t)1 << 63; - counter_adjustment = th->th_counter->tc_freq_adj; - scale += ((th->th_adjustment + counter_adjustment) / 1024) * 2199; + scale += (th->th_adjustment / 1024) * 2199; scale /= th->th_counter->tc_frequency; th->th_scale = scale * 2; @@ -753,7 +751,7 @@ sysctl_tc(int *name, u_int namelen, void *oldp, size_t *oldlenp, } /* - * Skew the timehands according to any adjtime(2) adjustment. + * Skew the timehands according to any adjfreq(2)/adjtime(2) adjustments. */ void ntp_update_second(struct timehands *th) @@ -768,6 +766,7 @@ ntp_update_second(struct timehands *th) adj = MAX(-5000, th->th_adjtimedelta); th->th_adjtimedelta -= adj; th->th_adjustment = (adj * 1000) << 32; + th->th_adjustment += th->th_counter->tc_freq_adj; } void |