Lines Matching refs:tkr

191 static inline u64 tk_clock_read(const struct tk_read_base *tkr)  in tk_clock_read()  argument
193 struct clocksource *clock = READ_ONCE(tkr->clock); in tk_clock_read()
240 static inline u64 timekeeping_get_delta(const struct tk_read_base *tkr) in timekeeping_get_delta() argument
255 now = tk_clock_read(tkr); in timekeeping_get_delta()
256 last = tkr->cycle_last; in timekeeping_get_delta()
257 mask = tkr->mask; in timekeeping_get_delta()
258 max = tkr->clock->max_cycles; in timekeeping_get_delta()
275 delta = tkr->clock->max_cycles; in timekeeping_get_delta()
284 static inline u64 timekeeping_get_delta(const struct tk_read_base *tkr) in timekeeping_get_delta() argument
289 cycle_now = tk_clock_read(tkr); in timekeeping_get_delta()
292 delta = clocksource_delta(cycle_now, tkr->cycle_last, tkr->mask); in timekeeping_get_delta()
374 static inline u64 timekeeping_delta_to_ns(const struct tk_read_base *tkr, u64 delta) in timekeeping_delta_to_ns() argument
378 nsec = delta * tkr->mult + tkr->xtime_nsec; in timekeeping_delta_to_ns()
379 nsec >>= tkr->shift; in timekeeping_delta_to_ns()
384 static inline u64 timekeeping_get_ns(const struct tk_read_base *tkr) in timekeeping_get_ns() argument
388 delta = timekeeping_get_delta(tkr); in timekeeping_get_ns()
389 return timekeeping_delta_to_ns(tkr, delta); in timekeeping_get_ns()
392 static inline u64 timekeeping_cycles_to_ns(const struct tk_read_base *tkr, u64 cycles) in timekeeping_cycles_to_ns() argument
397 delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask); in timekeeping_cycles_to_ns()
398 return timekeeping_delta_to_ns(tkr, delta); in timekeeping_cycles_to_ns()
416 static void update_fast_timekeeper(const struct tk_read_base *tkr, in update_fast_timekeeper() argument
425 memcpy(base, tkr, sizeof(*base)); in update_fast_timekeeper()
434 static __always_inline u64 fast_tk_get_delta_ns(struct tk_read_base *tkr) in fast_tk_get_delta_ns() argument
436 u64 delta, cycles = tk_clock_read(tkr); in fast_tk_get_delta_ns()
438 delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask); in fast_tk_get_delta_ns()
439 return timekeeping_delta_to_ns(tkr, delta); in fast_tk_get_delta_ns()
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 += fast_tk_get_delta_ns(tkr); in __ktime_get_fast_ns()
559 struct tk_read_base *tkr; in __ktime_get_real_fast() local
565 tkr = tkf->base + (seq & 0x01); in __ktime_get_real_fast()
566 basem = ktime_to_ns(tkr->base); in __ktime_get_real_fast()
567 baser = ktime_to_ns(tkr->base_real); in __ktime_get_real_fast()
568 delta = fast_tk_get_delta_ns(tkr); in __ktime_get_real_fast()
654 const struct tk_read_base *tkr = &tk->tkr_mono; in halt_fast_timekeeper() local
656 memcpy(&tkr_dummy, tkr, sizeof(tkr_dummy)); in halt_fast_timekeeper()
657 cycles_at_suspend = tk_clock_read(tkr); in halt_fast_timekeeper()
659 tkr_dummy.base_real = tkr->base + tk->offs_real; in halt_fast_timekeeper()
662 tkr = &tk->tkr_raw; in halt_fast_timekeeper()
663 memcpy(&tkr_dummy, tkr, sizeof(tkr_dummy)); in halt_fast_timekeeper()
2410 struct tk_read_base *tkr = &tk_core.timekeeper.tkr_mono; in random_get_entropy_fallback() local
2411 struct clocksource *clock = READ_ONCE(tkr->clock); in random_get_entropy_fallback()