Lines Matching refs:tkr
247 static inline u64 tk_clock_read(const struct tk_read_base *tkr) in tk_clock_read() argument
249 struct clocksource *clock = READ_ONCE(tkr->clock); in tk_clock_read()
329 static noinline u64 delta_to_ns_safe(const struct tk_read_base *tkr, u64 delta) in delta_to_ns_safe() argument
331 return mul_u64_u32_add_u64_shr(delta, tkr->mult, tkr->xtime_nsec, tkr->shift); in delta_to_ns_safe()
334 static inline u64 timekeeping_cycles_to_ns(const struct tk_read_base *tkr, u64 cycles) in timekeeping_cycles_to_ns() argument
337 u64 mask = tkr->mask, delta = (cycles - tkr->cycle_last) & mask; in timekeeping_cycles_to_ns()
343 if (unlikely(delta > tkr->clock->max_cycles)) { in timekeeping_cycles_to_ns()
350 return tkr->xtime_nsec >> tkr->shift; in timekeeping_cycles_to_ns()
352 return delta_to_ns_safe(tkr, delta); in timekeeping_cycles_to_ns()
355 return ((delta * tkr->mult) + tkr->xtime_nsec) >> tkr->shift; in timekeeping_cycles_to_ns()
358 static __always_inline u64 timekeeping_get_ns(const struct tk_read_base *tkr) in timekeeping_get_ns() argument
360 return timekeeping_cycles_to_ns(tkr, tk_clock_read(tkr)); in timekeeping_get_ns()
378 static void update_fast_timekeeper(const struct tk_read_base *tkr, in update_fast_timekeeper() argument
387 memcpy(base, tkr, sizeof(*base)); in update_fast_timekeeper()
400 struct tk_read_base *tkr; in __ktime_get_fast_ns() local
406 tkr = tkf->base + (seq & 0x01); in __ktime_get_fast_ns()
407 now = ktime_to_ns(tkr->base); in __ktime_get_fast_ns()
408 now += timekeeping_get_ns(tkr); in __ktime_get_fast_ns()
521 struct tk_read_base *tkr; in ktime_get_real_fast_ns() local
527 tkr = tkf->base + (seq & 0x01); in ktime_get_real_fast_ns()
528 baser = ktime_to_ns(tkr->base_real); in ktime_get_real_fast_ns()
529 delta = timekeeping_get_ns(tkr); in ktime_get_real_fast_ns()
549 const struct tk_read_base *tkr = &tk->tkr_mono; in halt_fast_timekeeper() local
551 memcpy(&tkr_dummy, tkr, sizeof(tkr_dummy)); in halt_fast_timekeeper()
552 cycles_at_suspend = tk_clock_read(tkr); in halt_fast_timekeeper()
554 tkr_dummy.base_real = tkr->base + tk->offs_real; in halt_fast_timekeeper()
557 tkr = &tk->tkr_raw; in halt_fast_timekeeper()
558 memcpy(&tkr_dummy, tkr, sizeof(tkr_dummy)); in halt_fast_timekeeper()
1199 struct tk_read_base *tkr = &tk_core.timekeeper.tkr_mono; in convert_ns_to_cs() local
1201 if (BITS_TO_BYTES(fls64(*delta) + tkr->shift) >= sizeof(*delta)) in convert_ns_to_cs()
1204 *delta = div_u64((*delta << tkr->shift) - tkr->xtime_nsec, tkr->mult); in convert_ns_to_cs()
2520 struct tk_read_base *tkr = &tk_core.timekeeper.tkr_mono; in random_get_entropy_fallback() local
2521 struct clocksource *clock = READ_ONCE(tkr->clock); in random_get_entropy_fallback()