FreeBSD/sys/kern/kern_tc.c
/*
 * Reset the feed-forward clock estimates. Called from inittodr() to get things
 * kick started and uses the timecounter nominal frequency as a first period
 * estimate. Note: this function may be called several time just after boot.
 * Note: this is the only function that sets the value of boot time for the
 * monotonic (i.e. uptime) version of the feed-forward clock.
 */
Reset the feed-forward clock estimates. Called from inittodr() to get things
kick started and uses the timecounter nominal frequency as a first period
estimate. Note: this function may be called several time just after boot.
Note: this is the only function that sets the value of boot time for the
monotonic  version of the feed-forward clock.
Reset the feed - forward clock estimates . Called from inittodr () to get things kick started and uses the timecounter nominal frequency as a first period estimate . Note : this function may be called several time just after boot . Note : this is the only function that sets the value of boot time for the monotonic version of the feed - forward clock .
void
ffclock_reset_clock(struct timespec *ts)
{
	struct timecounter *tc;
	struct ffclock_estimate cest;
	tc = timehands->th_counter;
	memset(&cest, 0, sizeof(struct ffclock_estimate));
	timespec2bintime(ts, &ffclock_boottime);
	timespec2bintime(ts, &(cest.update_time));
	ffclock_read_counter(&cest.update_ffcount);
	cest.leapsec_next = 0;
	cest.period = ((1ULL << 63) / tc->tc_frequency) << 1;
	cest.errb_abs = 0;
	cest.errb_rate = 0;
	cest.status = FFCLOCK_STA_UNSYNC;
	cest.leapsec_total = 0;
	cest.leapsec = 0;
	mtx_lock(&ffclock_mtx);
	bcopy(&cest, &ffclock_estimate, sizeof(struct ffclock_estimate));
	ffclock_updated = INT8_MAX;
	mtx_unlock(&ffclock_mtx);
	printf("ffclock reset: %s (%llu Hz), time = %ld.%09lu\n", tc->tc_name,
	    (unsigned long long)tc->tc_frequency, (long)ts->tv_sec,
	    (unsigned long)ts->tv_nsec);
}
void ffclock_reset_clock ( struct timespec * ts ) { struct timecounter * tc ; struct ffclock_estimate cest ; tc = timehands -> th_counter ; memset ( & cest , 0 , sizeof ( struct ffclock_estimate ) ) ; timespec2bintime ( ts , & ffclock_boottime ) ; timespec2bintime ( ts , & ( cest . update_time ) ) ; ffclock_read_counter ( & cest . update_ffcount ) ; cest . leapsec_next = 0 ; cest . period = ( ( 1ULL << 63 ) / tc -> tc_frequency ) << 1 ; cest . errb_abs = 0 ; cest . errb_rate = 0 ; cest . status = FFCLOCK_STA_UNSYNC ; cest . leapsec_total = 0 ; cest . leapsec = 0 ; mtx_lock ( & ffclock_mtx ) ; bcopy ( & cest , & ffclock_estimate , sizeof ( struct ffclock_estimate ) ) ; ffclock_updated = INT8_MAX ; mtx_unlock ( & ffclock_mtx ) ; printf ( " \n " , tc -> tc_name , ( unsigned long long ) tc -> tc_frequency , ( long ) ts -> tv_sec , ( unsigned long ) ts -> tv_nsec ) ; }
Reset the feed-forward clock estimates.
Reset the feed - forward clock estimates .