FreeBSD/sys/kern/kern_tc.c
/*
 * Step our concept of UTC.  This is done by modifying our estimate of
 * when we booted.
 * XXX: not locked.
 */
Step our concept of UTC.  This is done by modifying our estimate of
when we booted.
XXX: not locked.
Step our concept of UTC . This is done by modifying our estimate of when we booted . XXX : not locked .
void
tc_setclock(struct timespec *ts)
{
	struct timespec tbef, taft;
	struct bintime bt, bt2;
	cpu_tick_calibrate(1);
	nanotime(&tbef);
	timespec2bintime(ts, &bt);
	binuptime(&bt2);
	bintime_sub(&bt, &bt2);
	bintime_add(&bt2, &boottimebin);
	boottimebin = bt;
	bintime2timeval(&bt, &boottime);
	tc_windup();
	nanotime(&taft);
	if (timestepwarnings) {
		log(LOG_INFO,
		    "Time stepped from %jd.%09ld to %jd.%09ld (%jd.%09ld)\n",
		    (intmax_t)tbef.tv_sec, tbef.tv_nsec,
		    (intmax_t)taft.tv_sec, taft.tv_nsec,
		    (intmax_t)ts->tv_sec, ts->tv_nsec);
	}
	cpu_tick_calibrate(1);
}
void tc_setclock ( struct timespec * ts ) { struct timespec tbef , taft ; struct bintime bt , bt2 ; cpu_tick_calibrate ( 1 ) ; nanotime ( & tbef ) ; timespec2bintime ( ts , & bt ) ; binuptime ( & bt2 ) ; bintime_sub ( & bt , & bt2 ) ; bintime_add ( & bt2 , & boottimebin ) ; boottimebin = bt ; bintime2timeval ( & bt , & boottime ) ; tc_windup ( ) ; nanotime ( & taft ) ; if ( timestepwarnings ) { log ( LOG_INFO , " \n " , ( intmax_t ) tbef . tv_sec , tbef . tv_nsec , ( intmax_t ) taft . tv_sec , taft . tv_nsec , ( intmax_t ) ts -> tv_sec , ts -> tv_nsec ) ; } cpu_tick_calibrate ( 1 ) ; }
Step our concept of UTC.
Step our concept of UTC .
/* XXX fiddle all the little crinkly bits around the fiords... */