Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_tc.c
Show First 20 Lines • Show All 1,836 Lines • ▼ Show 20 Lines | #endif | ||||
pseq = &pps->ppsinfo.clear_sequence; | pseq = &pps->ppsinfo.clear_sequence; | ||||
#ifdef FFCLOCK | #ifdef FFCLOCK | ||||
ffcount = &pps->ppsinfo_ffc.clear_ffcount; | ffcount = &pps->ppsinfo_ffc.clear_ffcount; | ||||
tsp_ffc = &pps->ppsinfo_ffc.clear_timestamp; | tsp_ffc = &pps->ppsinfo_ffc.clear_timestamp; | ||||
pseq_ffc = &pps->ppsinfo_ffc.clear_sequence; | pseq_ffc = &pps->ppsinfo_ffc.clear_sequence; | ||||
#endif | #endif | ||||
} | } | ||||
*pcount = pps->capcount; | |||||
/* | /* | ||||
* If the timecounter changed, we cannot compare the count values, so | * If the timecounter changed, we cannot compare the count values, so | ||||
* we have to drop the rest of the PPS-stuff until the next event. | * we have to drop the rest of the PPS-stuff until the next event. | ||||
*/ | */ | ||||
if (__predict_false(pps->ppstc != captc)) { | if (__predict_false(pps->ppstc != captc)) { | ||||
pps->ppstc = captc; | pps->ppstc = captc; | ||||
*pcount = pps->capcount; | |||||
pps->ppscount[2] = pps->capcount; | pps->ppscount[2] = pps->capcount; | ||||
return; | return; | ||||
} | } | ||||
(*pseq)++; | |||||
/* Convert the count to a timespec. */ | /* Convert the count to a timespec. */ | ||||
tcount = pps->capcount - tcount; | tcount = pps->capcount - tcount; | ||||
tcount &= captc->tc_counter_mask; | tcount &= captc->tc_counter_mask; | ||||
bintime_addx(&bt, capth_scale * tcount); | bintime_addx(&bt, capth_scale * tcount); | ||||
bintime2timespec(&bt, &ts); | bintime2timespec(&bt, &ts); | ||||
*pcount = pps->capcount; | |||||
(*pseq)++; | |||||
*tsp = ts; | *tsp = ts; | ||||
if (foff) { | if (foff) { | ||||
timespecadd(tsp, osp, tsp); | timespecadd(tsp, osp, tsp); | ||||
if (tsp->tv_nsec < 0) { | if (tsp->tv_nsec < 0) { | ||||
tsp->tv_nsec += 1000000000; | tsp->tv_nsec += 1000000000; | ||||
tsp->tv_sec -= 1; | tsp->tv_sec -= 1; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 396 Lines • Show Last 20 Lines |