CVSROOT:        /cvs
Module name:    src
Changes by:     chel...@cvs.openbsd.org 2019/03/22 12:27:12

Modified files:
        sys/kern       : kern_tc.c 

Log message:
Move adjtimedelta into the timehands.

adjtimedelta is 64-bit and thus can't be read/written atomically on all
architectures.  Because it can be modified from tc_windup() and
ntp_update_second() we need a way to ensure safe reads/writes for
adjtime(2) callers.  One solution is to move it into the timehands and
adopt the lockless read protocol we now use for the system boot time and
uptime.

So make new_adjtimedelta an argument to tc_windup() and add a lockless
read loop to tc_adjtime().  With adjtimedelta stored in the timehands
we can now simply pass a timehands pointer to ntp_update_second().  This
makes ntp_update_second() safer as we're using the timehands' timecounter
pointer instead of the mutable global timecounter pointer.

Lots of input from mpi@ and visa@.

ok visa@

Reply via email to