Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_tc.c
Show All 30 Lines | |||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/sbuf.h> | #include <sys/sbuf.h> | ||||
#include <sys/sleepqueue.h> | #include <sys/sleepqueue.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <sys/syslog.h> | #include <sys/syslog.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/timeffc.h> | #include <sys/timeffc.h> | ||||
#include <sys/timepps.h> | #include <sys/timepps.h> | ||||
#include <sys/timerfd.h> | |||||
#include <sys/timetc.h> | #include <sys/timetc.h> | ||||
#include <sys/timex.h> | #include <sys/timex.h> | ||||
#include <sys/vdso.h> | #include <sys/vdso.h> | ||||
/* | /* | ||||
* A large step happens on boot. This constant detects such steps. | * A large step happens on boot. This constant detects such steps. | ||||
* It is relatively small so that ntp_update_second gets called enough | * It is relatively small so that ntp_update_second gets called enough | ||||
* in the typical 'missed a couple of seconds' case, but doesn't loop | * in the typical 'missed a couple of seconds' case, but doesn't loop | ||||
▲ Show 20 Lines • Show All 1,255 Lines • ▼ Show 20 Lines | tc_setclock(struct timespec *ts) | ||||
bintime_sub(&bt, &bt2); | bintime_sub(&bt, &bt2); | ||||
/* XXX fiddle all the little crinkly bits around the fiords... */ | /* XXX fiddle all the little crinkly bits around the fiords... */ | ||||
tc_windup(&bt); | tc_windup(&bt); | ||||
mtx_unlock_spin(&tc_setclock_mtx); | mtx_unlock_spin(&tc_setclock_mtx); | ||||
/* Avoid rtc_generation == 0, since td_rtcgen == 0 is special. */ | /* Avoid rtc_generation == 0, since td_rtcgen == 0 is special. */ | ||||
atomic_add_rel_int(&rtc_generation, 2); | atomic_add_rel_int(&rtc_generation, 2); | ||||
timerfd_jumped(); | |||||
sleepq_chains_remove_matching(sleeping_on_old_rtc); | sleepq_chains_remove_matching(sleeping_on_old_rtc); | ||||
if (timestepwarnings) { | if (timestepwarnings) { | ||||
nanotime(&taft); | nanotime(&taft); | ||||
log(LOG_INFO, | log(LOG_INFO, | ||||
"Time stepped from %jd.%09ld to %jd.%09ld (%jd.%09ld)\n", | "Time stepped from %jd.%09ld to %jd.%09ld (%jd.%09ld)\n", | ||||
(intmax_t)tbef.tv_sec, tbef.tv_nsec, | (intmax_t)tbef.tv_sec, tbef.tv_nsec, | ||||
(intmax_t)taft.tv_sec, taft.tv_nsec, | (intmax_t)taft.tv_sec, taft.tv_nsec, | ||||
(intmax_t)ts->tv_sec, ts->tv_nsec); | (intmax_t)ts->tv_sec, ts->tv_nsec); | ||||
▲ Show 20 Lines • Show All 946 Lines • Show Last 20 Lines |