Lines Matching refs:tkr
291 static inline u64 tk_clock_read(const struct tk_read_base *tkr) in tk_clock_read() argument
293 struct clocksource *clock = READ_ONCE(tkr->clock); in tk_clock_read()
373 static noinline u64 delta_to_ns_safe(const struct tk_read_base *tkr, u64 delta) in delta_to_ns_safe() argument
375 return mul_u64_u32_add_u64_shr(delta, tkr->mult, tkr->xtime_nsec, tkr->shift); in delta_to_ns_safe()
378 static inline u64 timekeeping_cycles_to_ns(const struct tk_read_base *tkr, u64 cycles) in timekeeping_cycles_to_ns() argument
381 u64 mask = tkr->mask, delta = (cycles - tkr->cycle_last) & mask; in timekeeping_cycles_to_ns()
387 if (unlikely(delta > tkr->clock->max_cycles)) { in timekeeping_cycles_to_ns()
394 return tkr->xtime_nsec >> tkr->shift; in timekeeping_cycles_to_ns()
396 return delta_to_ns_safe(tkr, delta); in timekeeping_cycles_to_ns()
399 return ((delta * tkr->mult) + tkr->xtime_nsec) >> tkr->shift; in timekeeping_cycles_to_ns()
402 static __always_inline u64 timekeeping_get_ns(const struct tk_read_base *tkr) in timekeeping_get_ns() argument
404 return timekeeping_cycles_to_ns(tkr, tk_clock_read(tkr)); in timekeeping_get_ns()
422 static void update_fast_timekeeper(const struct tk_read_base *tkr, in update_fast_timekeeper() argument
431 memcpy(base, tkr, sizeof(*base)); in update_fast_timekeeper()
444 struct tk_read_base *tkr; in __ktime_get_fast_ns() local
450 tkr = tkf->base + (seq & 0x01); in __ktime_get_fast_ns()
451 now = ktime_to_ns(tkr->base); in __ktime_get_fast_ns()
452 now += timekeeping_get_ns(tkr); in __ktime_get_fast_ns()
565 struct tk_read_base *tkr; in ktime_get_real_fast_ns() local
571 tkr = tkf->base + (seq & 0x01); in ktime_get_real_fast_ns()
572 baser = ktime_to_ns(tkr->base_real); in ktime_get_real_fast_ns()
573 delta = timekeeping_get_ns(tkr); in ktime_get_real_fast_ns()
593 const struct tk_read_base *tkr = &tk->tkr_mono; in halt_fast_timekeeper() local
595 memcpy(&tkr_dummy, tkr, sizeof(tkr_dummy)); in halt_fast_timekeeper()
596 cycles_at_suspend = tk_clock_read(tkr); in halt_fast_timekeeper()
598 tkr_dummy.base_real = tkr->base + tk->offs_real; in halt_fast_timekeeper()
601 tkr = &tk->tkr_raw; in halt_fast_timekeeper()
602 memcpy(&tkr_dummy, tkr, sizeof(tkr_dummy)); in halt_fast_timekeeper()
1252 struct tk_read_base *tkr = &tk_core.timekeeper.tkr_mono; in convert_ns_to_cs() local
1254 if (BITS_TO_BYTES(fls64(*delta) + tkr->shift) >= sizeof(*delta)) in convert_ns_to_cs()
1257 *delta = div_u64((*delta << tkr->shift) - tkr->xtime_nsec, tkr->mult); in convert_ns_to_cs()
2679 struct tk_read_base *tkr = &tk_core.timekeeper.tkr_mono; in random_get_entropy_fallback() local
2680 struct clocksource *clock = READ_ONCE(tkr->clock); in random_get_entropy_fallback()