Lines Matching refs:tk
146 static inline void tk_normalize_xtime(struct timekeeper *tk) in tk_normalize_xtime() argument
148 while (tk->tkr_mono.xtime_nsec >= ((u64)NSEC_PER_SEC << tk->tkr_mono.shift)) { in tk_normalize_xtime()
149 tk->tkr_mono.xtime_nsec -= (u64)NSEC_PER_SEC << tk->tkr_mono.shift; in tk_normalize_xtime()
150 tk->xtime_sec++; in tk_normalize_xtime()
152 while (tk->tkr_raw.xtime_nsec >= ((u64)NSEC_PER_SEC << tk->tkr_raw.shift)) { in tk_normalize_xtime()
153 tk->tkr_raw.xtime_nsec -= (u64)NSEC_PER_SEC << tk->tkr_raw.shift; in tk_normalize_xtime()
154 tk->raw_sec++; in tk_normalize_xtime()
158 static inline struct timespec64 tk_xtime(const struct timekeeper *tk) in tk_xtime() argument
162 ts.tv_sec = tk->xtime_sec; in tk_xtime()
163 ts.tv_nsec = (long)(tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift); in tk_xtime()
167 static inline struct timespec64 tk_xtime_coarse(const struct timekeeper *tk) in tk_xtime_coarse() argument
171 ts.tv_sec = tk->xtime_sec; in tk_xtime_coarse()
172 ts.tv_nsec = tk->coarse_nsec; in tk_xtime_coarse()
185 static inline void tk_update_coarse_nsecs(struct timekeeper *tk) in tk_update_coarse_nsecs() argument
187 tk->coarse_nsec = tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift; in tk_update_coarse_nsecs()
190 static void tk_set_xtime(struct timekeeper *tk, const struct timespec64 *ts) in tk_set_xtime() argument
192 tk->xtime_sec = ts->tv_sec; in tk_set_xtime()
193 tk->tkr_mono.xtime_nsec = (u64)ts->tv_nsec << tk->tkr_mono.shift; in tk_set_xtime()
194 tk_update_coarse_nsecs(tk); in tk_set_xtime()
197 static void tk_xtime_add(struct timekeeper *tk, const struct timespec64 *ts) in tk_xtime_add() argument
199 tk->xtime_sec += ts->tv_sec; in tk_xtime_add()
200 tk->tkr_mono.xtime_nsec += (u64)ts->tv_nsec << tk->tkr_mono.shift; in tk_xtime_add()
201 tk_normalize_xtime(tk); in tk_xtime_add()
202 tk_update_coarse_nsecs(tk); in tk_xtime_add()
205 static void tk_set_wall_to_mono(struct timekeeper *tk, struct timespec64 wtm) in tk_set_wall_to_mono() argument
213 set_normalized_timespec64(&tmp, -tk->wall_to_monotonic.tv_sec, in tk_set_wall_to_mono()
214 -tk->wall_to_monotonic.tv_nsec); in tk_set_wall_to_mono()
215 WARN_ON_ONCE(tk->offs_real != timespec64_to_ktime(tmp)); in tk_set_wall_to_mono()
216 tk->wall_to_monotonic = wtm; in tk_set_wall_to_mono()
219 WRITE_ONCE(tk->offs_real, timespec64_to_ktime(tmp)); in tk_set_wall_to_mono()
220 WRITE_ONCE(tk->offs_tai, ktime_add(tk->offs_real, ktime_set(tk->tai_offset, 0))); in tk_set_wall_to_mono()
223 static inline void tk_update_sleep_time(struct timekeeper *tk, ktime_t delta) in tk_update_sleep_time() argument
226 WRITE_ONCE(tk->offs_boot, ktime_add(tk->offs_boot, delta)); in tk_update_sleep_time()
231 tk->monotonic_to_boot = ktime_to_timespec64(tk->offs_boot); in tk_update_sleep_time()
265 static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock) in tk_setup_internals() argument
271 ++tk->cs_was_changed_seq; in tk_setup_internals()
272 old_clock = tk->tkr_mono.clock; in tk_setup_internals()
273 tk->tkr_mono.clock = clock; in tk_setup_internals()
274 tk->tkr_mono.mask = clock->mask; in tk_setup_internals()
275 tk->tkr_mono.cycle_last = tk_clock_read(&tk->tkr_mono); in tk_setup_internals()
277 tk->tkr_raw.clock = clock; in tk_setup_internals()
278 tk->tkr_raw.mask = clock->mask; in tk_setup_internals()
279 tk->tkr_raw.cycle_last = tk->tkr_mono.cycle_last; in tk_setup_internals()
291 tk->cycle_interval = interval; in tk_setup_internals()
294 tk->xtime_interval = interval * clock->mult; in tk_setup_internals()
295 tk->xtime_remainder = ntpinterval - tk->xtime_interval; in tk_setup_internals()
296 tk->raw_interval = interval * clock->mult; in tk_setup_internals()
302 tk->tkr_mono.xtime_nsec >>= -shift_change; in tk_setup_internals()
303 tk->tkr_raw.xtime_nsec >>= -shift_change; in tk_setup_internals()
305 tk->tkr_mono.xtime_nsec <<= shift_change; in tk_setup_internals()
306 tk->tkr_raw.xtime_nsec <<= shift_change; in tk_setup_internals()
310 tk->tkr_mono.shift = clock->shift; in tk_setup_internals()
311 tk->tkr_raw.shift = clock->shift; in tk_setup_internals()
313 tk->ntp_error = 0; in tk_setup_internals()
314 tk->ntp_error_shift = NTP_SCALE_SHIFT - clock->shift; in tk_setup_internals()
315 tk->ntp_tick = ntpinterval << tk->ntp_error_shift; in tk_setup_internals()
322 tk->tkr_mono.mult = clock->mult; in tk_setup_internals()
323 tk->tkr_raw.mult = clock->mult; in tk_setup_internals()
324 tk->ntp_err_mult = 0; in tk_setup_internals()
325 tk->skip_second_overflow = 0; in tk_setup_internals()
490 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_boot_fast_ns() local
492 return (ktime_get_mono_fast_ns() + ktime_to_ns(data_race(tk->offs_boot))); in ktime_get_boot_fast_ns()
507 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_tai_fast_ns() local
509 return (ktime_get_mono_fast_ns() + ktime_to_ns(data_race(tk->offs_tai))); in ktime_get_tai_fast_ns()
546 static void halt_fast_timekeeper(const struct timekeeper *tk) in halt_fast_timekeeper() argument
549 const struct tk_read_base *tkr = &tk->tkr_mono; 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()
565 static void update_pvclock_gtod(struct timekeeper *tk, bool was_set) in update_pvclock_gtod() argument
567 raw_notifier_call_chain(&pvclock_gtod_chain, was_set, tk); in update_pvclock_gtod()
576 struct timekeeper *tk = &tk_core.timekeeper; in pvclock_gtod_register_notifier() local
581 update_pvclock_gtod(tk, true); in pvclock_gtod_register_notifier()
602 static inline void tk_update_leap_state(struct timekeeper *tk) in tk_update_leap_state() argument
604 tk->next_leap_ktime = ntp_get_next_leap(); in tk_update_leap_state()
605 if (tk->next_leap_ktime != KTIME_MAX) in tk_update_leap_state()
607 tk->next_leap_ktime = ktime_sub(tk->next_leap_ktime, tk->offs_real); in tk_update_leap_state()
625 static inline void tk_update_ktime_data(struct timekeeper *tk) in tk_update_ktime_data() argument
637 seconds = (u64)(tk->xtime_sec + tk->wall_to_monotonic.tv_sec); in tk_update_ktime_data()
638 nsec = (u32) tk->wall_to_monotonic.tv_nsec; in tk_update_ktime_data()
639 tk->tkr_mono.base = ns_to_ktime(seconds * NSEC_PER_SEC + nsec); in tk_update_ktime_data()
646 nsec += (u32)(tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift); in tk_update_ktime_data()
649 tk->ktime_sec = seconds; in tk_update_ktime_data()
652 tk->tkr_raw.base = ns_to_ktime(tk->raw_sec * NSEC_PER_SEC); in tk_update_ktime_data()
666 struct timekeeper *tk = &tk_core.shadow_timekeeper; in timekeeping_update_from_shadow() local
680 tk->ntp_error = 0; in timekeeping_update_from_shadow()
684 tk_update_leap_state(tk); in timekeeping_update_from_shadow()
685 tk_update_ktime_data(tk); in timekeeping_update_from_shadow()
687 update_vsyscall(tk); in timekeeping_update_from_shadow()
688 update_pvclock_gtod(tk, action & TK_CLOCK_WAS_SET); in timekeeping_update_from_shadow()
690 tk->tkr_mono.base_real = tk->tkr_mono.base + tk->offs_real; in timekeeping_update_from_shadow()
691 update_fast_timekeeper(&tk->tkr_mono, &tk_fast_mono); in timekeeping_update_from_shadow()
692 update_fast_timekeeper(&tk->tkr_raw, &tk_fast_raw); in timekeeping_update_from_shadow()
695 tk->clock_was_set_seq++; in timekeeping_update_from_shadow()
705 memcpy(&tkd->timekeeper, tk, sizeof(*tk)); in timekeeping_update_from_shadow()
717 static void timekeeping_forward_now(struct timekeeper *tk) in timekeeping_forward_now() argument
721 cycle_now = tk_clock_read(&tk->tkr_mono); in timekeeping_forward_now()
722 delta = clocksource_delta(cycle_now, tk->tkr_mono.cycle_last, tk->tkr_mono.mask, in timekeeping_forward_now()
723 tk->tkr_mono.clock->max_raw_delta); in timekeeping_forward_now()
724 tk->tkr_mono.cycle_last = cycle_now; in timekeeping_forward_now()
725 tk->tkr_raw.cycle_last = cycle_now; in timekeeping_forward_now()
728 u64 max = tk->tkr_mono.clock->max_cycles; in timekeeping_forward_now()
731 tk->tkr_mono.xtime_nsec += incr * tk->tkr_mono.mult; in timekeeping_forward_now()
732 tk->tkr_raw.xtime_nsec += incr * tk->tkr_raw.mult; in timekeeping_forward_now()
733 tk_normalize_xtime(tk); in timekeeping_forward_now()
736 tk_update_coarse_nsecs(tk); in timekeeping_forward_now()
747 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_real_ts64() local
756 ts->tv_sec = tk->xtime_sec; in ktime_get_real_ts64()
757 nsecs = timekeeping_get_ns(&tk->tkr_mono); in ktime_get_real_ts64()
768 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get() local
777 base = tk->tkr_mono.base; in ktime_get()
778 nsecs = timekeeping_get_ns(&tk->tkr_mono); in ktime_get()
788 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_resolution_ns() local
796 nsecs = tk->tkr_mono.mult >> tk->tkr_mono.shift; in ktime_get_resolution_ns()
811 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_with_offset() local
820 base = ktime_add(tk->tkr_mono.base, *offset); in ktime_get_with_offset()
821 nsecs = timekeeping_get_ns(&tk->tkr_mono); in ktime_get_with_offset()
832 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_coarse_with_offset() local
841 base = ktime_add(tk->tkr_mono.base, *offset); in ktime_get_coarse_with_offset()
842 nsecs = tk->coarse_nsec; in ktime_get_coarse_with_offset()
883 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_raw() local
890 base = tk->tkr_raw.base; in ktime_get_raw()
891 nsecs = timekeeping_get_ns(&tk->tkr_raw); in ktime_get_raw()
909 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_ts64() local
918 ts->tv_sec = tk->xtime_sec; in ktime_get_ts64()
919 nsec = timekeeping_get_ns(&tk->tkr_mono); in ktime_get_ts64()
920 tomono = tk->wall_to_monotonic; in ktime_get_ts64()
941 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_seconds() local
944 return tk->ktime_sec; in ktime_get_seconds()
960 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_real_seconds() local
965 return tk->xtime_sec; in ktime_get_real_seconds()
969 seconds = tk->xtime_sec; in ktime_get_real_seconds()
984 struct timekeeper *tk = &tk_core.timekeeper; in __ktime_get_real_seconds() local
986 return tk->xtime_sec; in __ktime_get_real_seconds()
995 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_snapshot() local
1008 now = tk_clock_read(&tk->tkr_mono); in ktime_get_snapshot()
1009 systime_snapshot->cs_id = tk->tkr_mono.clock->id; in ktime_get_snapshot()
1010 systime_snapshot->cs_was_changed_seq = tk->cs_was_changed_seq; in ktime_get_snapshot()
1011 systime_snapshot->clock_was_set_seq = tk->clock_was_set_seq; in ktime_get_snapshot()
1012 base_real = ktime_add(tk->tkr_mono.base, in ktime_get_snapshot()
1014 base_boot = ktime_add(tk->tkr_mono.base, in ktime_get_snapshot()
1016 base_raw = tk->tkr_raw.base; in ktime_get_snapshot()
1017 nsec_real = timekeeping_cycles_to_ns(&tk->tkr_mono, now); in ktime_get_snapshot()
1018 nsec_raw = timekeeping_cycles_to_ns(&tk->tkr_raw, now); in ktime_get_snapshot()
1068 struct timekeeper *tk = &tk_core.timekeeper; in adjust_historical_crosststamp() local
1102 (corr_raw, tk->tkr_mono.mult, tk->tkr_raw.mult); in adjust_historical_crosststamp()
1220 struct timekeeper *tk = &tk_core.timekeeper; in ktime_real_to_base_clock() local
1226 if ((u64)treal < tk->tkr_mono.base_real) in ktime_real_to_base_clock()
1228 delta = (u64)treal - tk->tkr_mono.base_real; in ktime_real_to_base_clock()
1231 *cycles = tk->tkr_mono.cycle_last + delta; in ktime_real_to_base_clock()
1260 struct timekeeper *tk = &tk_core.timekeeper; in get_device_system_crosststamp() local
1294 now = tk_clock_read(&tk->tkr_mono); in get_device_system_crosststamp()
1295 interval_start = tk->tkr_mono.cycle_last; in get_device_system_crosststamp()
1297 clock_was_set_seq = tk->clock_was_set_seq; in get_device_system_crosststamp()
1298 cs_was_changed_seq = tk->cs_was_changed_seq; in get_device_system_crosststamp()
1305 base_real = ktime_add(tk->tkr_mono.base, in get_device_system_crosststamp()
1307 base_raw = tk->tkr_raw.base; in get_device_system_crosststamp()
1309 nsec_real = timekeeping_cycles_to_ns(&tk->tkr_mono, cycles); in get_device_system_crosststamp()
1310 nsec_raw = timekeeping_cycles_to_ns(&tk->tkr_raw, cycles); in get_device_system_crosststamp()
1487 static void __timekeeping_set_tai_offset(struct timekeeper *tk, s32 tai_offset) in __timekeeping_set_tai_offset() argument
1489 tk->tai_offset = tai_offset; in __timekeeping_set_tai_offset()
1490 tk->offs_tai = ktime_add(tk->offs_real, ktime_set(tai_offset, 0)); in __timekeeping_set_tai_offset()
1543 struct timekeeper *tk = &tk_core.timekeeper; in timekeeping_notify() local
1545 if (tk->tkr_mono.clock == clock) in timekeeping_notify()
1549 return tk->tkr_mono.clock == clock ? 0 : -1; in timekeeping_notify()
1560 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_raw_ts64() local
1566 ts->tv_sec = tk->raw_sec; in ktime_get_raw_ts64()
1567 nsecs = timekeeping_get_ns(&tk->tkr_raw); in ktime_get_raw_ts64()
1582 struct timekeeper *tk = &tk_core.timekeeper; in timekeeping_valid_for_hres() local
1589 ret = tk->tkr_mono.clock->flags & CLOCK_SOURCE_VALID_FOR_HRES; in timekeeping_valid_for_hres()
1601 struct timekeeper *tk = &tk_core.timekeeper; in timekeeping_max_deferment() local
1608 ret = tk->tkr_mono.clock->max_idle_ns; in timekeeping_max_deferment()
1733 static void __timekeeping_inject_sleeptime(struct timekeeper *tk, in __timekeeping_inject_sleeptime() argument
1742 tk_xtime_add(tk, delta); in __timekeeping_inject_sleeptime()
1743 tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, *delta)); in __timekeeping_inject_sleeptime()
1744 tk_update_sleep_time(tk, timespec64_to_ktime(*delta)); in __timekeeping_inject_sleeptime()
1957 static __always_inline void timekeeping_apply_adjustment(struct timekeeper *tk, in timekeeping_apply_adjustment() argument
1961 s64 interval = tk->cycle_interval; in timekeeping_apply_adjustment()
2020 if ((mult_adj > 0) && (tk->tkr_mono.mult + mult_adj < mult_adj)) { in timekeeping_apply_adjustment()
2026 tk->tkr_mono.mult += mult_adj; in timekeeping_apply_adjustment()
2027 tk->xtime_interval += interval; in timekeeping_apply_adjustment()
2028 tk->tkr_mono.xtime_nsec -= offset; in timekeeping_apply_adjustment()
2035 static void timekeeping_adjust(struct timekeeper *tk, s64 offset) in timekeeping_adjust() argument
2044 if (likely(tk->ntp_tick == ntp_tl)) { in timekeeping_adjust()
2045 mult = tk->tkr_mono.mult - tk->ntp_err_mult; in timekeeping_adjust()
2047 tk->ntp_tick = ntp_tl; in timekeeping_adjust()
2048 mult = div64_u64((tk->ntp_tick >> tk->ntp_error_shift) - in timekeeping_adjust()
2049 tk->xtime_remainder, tk->cycle_interval); in timekeeping_adjust()
2058 tk->ntp_err_mult = tk->ntp_error > 0 ? 1 : 0; in timekeeping_adjust()
2059 mult += tk->ntp_err_mult; in timekeeping_adjust()
2061 timekeeping_apply_adjustment(tk, offset, mult - tk->tkr_mono.mult); in timekeeping_adjust()
2063 if (unlikely(tk->tkr_mono.clock->maxadj && in timekeeping_adjust()
2064 (abs(tk->tkr_mono.mult - tk->tkr_mono.clock->mult) in timekeeping_adjust()
2065 > tk->tkr_mono.clock->maxadj))) { in timekeeping_adjust()
2068 tk->tkr_mono.clock->name, (long)tk->tkr_mono.mult, in timekeeping_adjust()
2069 (long)tk->tkr_mono.clock->mult + tk->tkr_mono.clock->maxadj); in timekeeping_adjust()
2082 if (unlikely((s64)tk->tkr_mono.xtime_nsec < 0)) { in timekeeping_adjust()
2083 tk->tkr_mono.xtime_nsec += (u64)NSEC_PER_SEC << in timekeeping_adjust()
2084 tk->tkr_mono.shift; in timekeeping_adjust()
2085 tk->xtime_sec--; in timekeeping_adjust()
2086 tk->skip_second_overflow = 1; in timekeeping_adjust()
2097 static inline unsigned int accumulate_nsecs_to_secs(struct timekeeper *tk) in accumulate_nsecs_to_secs() argument
2099 u64 nsecps = (u64)NSEC_PER_SEC << tk->tkr_mono.shift; in accumulate_nsecs_to_secs()
2102 while (tk->tkr_mono.xtime_nsec >= nsecps) { in accumulate_nsecs_to_secs()
2105 tk->tkr_mono.xtime_nsec -= nsecps; in accumulate_nsecs_to_secs()
2106 tk->xtime_sec++; in accumulate_nsecs_to_secs()
2112 if (unlikely(tk->skip_second_overflow)) { in accumulate_nsecs_to_secs()
2113 tk->skip_second_overflow = 0; in accumulate_nsecs_to_secs()
2118 leap = second_overflow(tk->xtime_sec); in accumulate_nsecs_to_secs()
2122 tk->xtime_sec += leap; in accumulate_nsecs_to_secs()
2126 tk_set_wall_to_mono(tk, in accumulate_nsecs_to_secs()
2127 timespec64_sub(tk->wall_to_monotonic, ts)); in accumulate_nsecs_to_secs()
2129 __timekeeping_set_tai_offset(tk, tk->tai_offset - leap); in accumulate_nsecs_to_secs()
2146 static u64 logarithmic_accumulation(struct timekeeper *tk, u64 offset, in logarithmic_accumulation() argument
2149 u64 interval = tk->cycle_interval << shift; in logarithmic_accumulation()
2158 tk->tkr_mono.cycle_last += interval; in logarithmic_accumulation()
2159 tk->tkr_raw.cycle_last += interval; in logarithmic_accumulation()
2161 tk->tkr_mono.xtime_nsec += tk->xtime_interval << shift; in logarithmic_accumulation()
2162 *clock_set |= accumulate_nsecs_to_secs(tk); in logarithmic_accumulation()
2165 tk->tkr_raw.xtime_nsec += tk->raw_interval << shift; in logarithmic_accumulation()
2166 snsec_per_sec = (u64)NSEC_PER_SEC << tk->tkr_raw.shift; in logarithmic_accumulation()
2167 while (tk->tkr_raw.xtime_nsec >= snsec_per_sec) { in logarithmic_accumulation()
2168 tk->tkr_raw.xtime_nsec -= snsec_per_sec; in logarithmic_accumulation()
2169 tk->raw_sec++; in logarithmic_accumulation()
2173 tk->ntp_error += tk->ntp_tick << shift; in logarithmic_accumulation()
2174 tk->ntp_error -= (tk->xtime_interval + tk->xtime_remainder) << in logarithmic_accumulation()
2175 (tk->ntp_error_shift + shift); in logarithmic_accumulation()
2186 struct timekeeper *tk = &tk_core.shadow_timekeeper; in timekeeping_advance() local
2198 offset = clocksource_delta(tk_clock_read(&tk->tkr_mono), in timekeeping_advance()
2199 tk->tkr_mono.cycle_last, tk->tkr_mono.mask, in timekeeping_advance()
2200 tk->tkr_mono.clock->max_raw_delta); in timekeeping_advance()
2214 shift = ilog2(offset) - ilog2(tk->cycle_interval); in timekeeping_advance()
2219 while (offset >= tk->cycle_interval) { in timekeeping_advance()
2220 offset = logarithmic_accumulation(tk, offset, shift, &clock_set); in timekeeping_advance()
2221 if (offset < tk->cycle_interval<<shift) in timekeeping_advance()
2226 timekeeping_adjust(tk, offset); in timekeeping_advance()
2232 clock_set |= accumulate_nsecs_to_secs(tk); in timekeeping_advance()
2240 tk_update_coarse_nsecs(tk); in timekeeping_advance()
2270 struct timekeeper *tk = &tk_core.timekeeper; in getboottime64() local
2271 ktime_t t = ktime_sub(tk->offs_real, tk->offs_boot); in getboottime64()
2279 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_coarse_real_ts64() local
2285 *ts = tk_xtime_coarse(tk); in ktime_get_coarse_real_ts64()
2301 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_coarse_real_ts64_mg() local
2308 *ts = tk_xtime_coarse(tk); in ktime_get_coarse_real_ts64_mg()
2339 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_real_ts64_mg() local
2348 ts->tv_sec = tk->xtime_sec; in ktime_get_real_ts64_mg()
2349 mono = tk->tkr_mono.base; in ktime_get_real_ts64_mg()
2350 nsecs = timekeeping_get_ns(&tk->tkr_mono); in ktime_get_real_ts64_mg()
2380 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_coarse_ts64() local
2387 now = tk_xtime_coarse(tk); in ktime_get_coarse_ts64()
2388 mono = tk->wall_to_monotonic; in ktime_get_coarse_ts64()
2421 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_update_offsets_now() local
2429 base = tk->tkr_mono.base; in ktime_get_update_offsets_now()
2430 nsecs = timekeeping_get_ns(&tk->tkr_mono); in ktime_get_update_offsets_now()
2433 if (*cwsseq != tk->clock_was_set_seq) { in ktime_get_update_offsets_now()
2434 *cwsseq = tk->clock_was_set_seq; in ktime_get_update_offsets_now()
2435 *offs_real = tk->offs_real; in ktime_get_update_offsets_now()
2436 *offs_boot = tk->offs_boot; in ktime_get_update_offsets_now()
2437 *offs_tai = tk->offs_tai; in ktime_get_update_offsets_now()
2441 if (unlikely(base >= tk->next_leap_ktime)) in ktime_get_update_offsets_now()
2442 *offs_real = ktime_sub(tk->offs_real, ktime_set(1, 0)); in ktime_get_update_offsets_now()