Lines Matching refs:timecounter
46 * Implement a dummy timecounter which we can use until we get a real one
52 dummy_get_timecount(struct timecounter *tc)
59 static struct timecounter dummy_timecounter = {
65 struct timecounter *th_counter;
100 struct timecounter *timecounter = &dummy_timecounter;
101 static struct timecounter *timecounters = &dummy_timecounter;
114 SYSCTL_NODE(_kern, OID_AUTO, timecounter, CTLFLAG_RW, 0, "");
129 TUNABLE_INT("kern.timecounter.alloweddeviation", &tc_timepercentage);
162 struct timecounter *tc = arg1;
172 struct timecounter *tc = arg1;
185 struct timecounter *tc;
478 * have some connection to avoid accessing the timecounter hardware more than
524 * kick started and uses the timecounter nominal frequency as a first period
532 struct timecounter *tc;
738 * Adjust the fftimehands when the timecounter is changed. Stating the obvious,
752 struct timecounter *tc;
1137 * Initialize a new timecounter and possibly use it.
1140 tc_init(struct timecounter *tc)
1169 CTLFLAG_RW, 0, "timecounter description");
1175 sysctl_kern_timecounter_get, "IU", "current timecounter value");
1178 sysctl_kern_timecounter_freq, "QU", "timecounter frequency");
1183 * Never automatically use a timecounter with negative quality.
1185 * worse since this timecounter may not be monotonous.
1189 if (tc->tc_quality < timecounter->tc_quality)
1191 if (tc->tc_quality == timecounter->tc_quality &&
1192 tc->tc_frequency < timecounter->tc_frequency)
1196 timecounter = tc;
1199 /* Report the frequency of the current timecounter. */
1243 * timecounter and/or do seconds processing in NTP. Slightly magic.
1267 * Capture a timecounter delta on the current timecounter and if
1268 * changing timecounters, a counter value from the new timecounter.
1272 if (th->th_counter != timecounter)
1273 ncount = timecounter->tc_get_timecount(timecounter);
1330 if (th->th_counter != timecounter) {
1332 if ((timecounter->tc_flags & TC_FLAGS_C2STOP) != 0)
1337 th->th_counter = timecounter;
1339 tc_min_ticktock_freq = max(1, timecounter->tc_frequency /
1340 (((uint64_t)timecounter->tc_counter_mask + 1) / 3));
1402 /* Report or change the active timecounter hardware. */
1407 struct timecounter *newtc, *tc;
1410 tc = timecounter;
1421 /* Warm up new timecounter. */
1425 timecounter = newtc;
1437 /* Report or change the active timecounter hardware. */
1442 struct timecounter *tc;
1671 /* If the timecounter was wound up underneath us, bail out. */
1703 * If the timecounter changed, we cannot compare the count values, so
1721 /* If the timecounter was wound up underneath us, bail out. */
1863 /* warm up new timecounter (again) and get rolling. */
1864 (void)timecounter->tc_get_timecount(timecounter);
1865 (void)timecounter->tc_get_timecount(timecounter);
1869 SYSINIT(timecounter, SI_SUB_CLOCKS, SI_ORDER_SECOND, inittimecounter, NULL);
1882 struct timecounter *tc;