Lines Matching refs:tk

67 static inline void tk_normalize_xtime(struct timekeeper *tk)  in tk_normalize_xtime()  argument
69 while (tk->tkr_mono.xtime_nsec >= ((u64)NSEC_PER_SEC << tk->tkr_mono.shift)) { in tk_normalize_xtime()
70 tk->tkr_mono.xtime_nsec -= (u64)NSEC_PER_SEC << tk->tkr_mono.shift; in tk_normalize_xtime()
71 tk->xtime_sec++; in tk_normalize_xtime()
75 static inline struct timespec64 tk_xtime(struct timekeeper *tk) in tk_xtime() argument
79 ts.tv_sec = tk->xtime_sec; in tk_xtime()
80 ts.tv_nsec = (long)(tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift); in tk_xtime()
84 static void tk_set_xtime(struct timekeeper *tk, const struct timespec64 *ts) in tk_set_xtime() argument
86 tk->xtime_sec = ts->tv_sec; in tk_set_xtime()
87 tk->tkr_mono.xtime_nsec = (u64)ts->tv_nsec << tk->tkr_mono.shift; in tk_set_xtime()
90 static void tk_xtime_add(struct timekeeper *tk, const struct timespec64 *ts) in tk_xtime_add() argument
92 tk->xtime_sec += ts->tv_sec; in tk_xtime_add()
93 tk->tkr_mono.xtime_nsec += (u64)ts->tv_nsec << tk->tkr_mono.shift; in tk_xtime_add()
94 tk_normalize_xtime(tk); in tk_xtime_add()
97 static void tk_set_wall_to_mono(struct timekeeper *tk, struct timespec64 wtm) in tk_set_wall_to_mono() argument
105 set_normalized_timespec64(&tmp, -tk->wall_to_monotonic.tv_sec, in tk_set_wall_to_mono()
106 -tk->wall_to_monotonic.tv_nsec); in tk_set_wall_to_mono()
107 WARN_ON_ONCE(tk->offs_real.tv64 != timespec64_to_ktime(tmp).tv64); in tk_set_wall_to_mono()
108 tk->wall_to_monotonic = wtm; in tk_set_wall_to_mono()
110 tk->offs_real = timespec64_to_ktime(tmp); in tk_set_wall_to_mono()
111 tk->offs_tai = ktime_add(tk->offs_real, ktime_set(tk->tai_offset, 0)); in tk_set_wall_to_mono()
114 static inline void tk_update_sleep_time(struct timekeeper *tk, ktime_t delta) in tk_update_sleep_time() argument
116 tk->offs_boot = ktime_add(tk->offs_boot, delta); in tk_update_sleep_time()
134 static void timekeeping_check_update(struct timekeeper *tk, cycle_t offset) in timekeeping_check_update() argument
137 cycle_t max_cycles = tk->tkr_mono.clock->max_cycles; in timekeeping_check_update()
138 const char *name = tk->tkr_mono.clock->name; in timekeeping_check_update()
213 static inline void timekeeping_check_update(struct timekeeper *tk, cycle_t offset) in timekeeping_check_update() argument
241 static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock) in tk_setup_internals() argument
247 old_clock = tk->tkr_mono.clock; in tk_setup_internals()
248 tk->tkr_mono.clock = clock; in tk_setup_internals()
249 tk->tkr_mono.read = clock->read; in tk_setup_internals()
250 tk->tkr_mono.mask = clock->mask; in tk_setup_internals()
251 tk->tkr_mono.cycle_last = tk->tkr_mono.read(clock); in tk_setup_internals()
253 tk->tkr_raw.clock = clock; in tk_setup_internals()
254 tk->tkr_raw.read = clock->read; in tk_setup_internals()
255 tk->tkr_raw.mask = clock->mask; in tk_setup_internals()
256 tk->tkr_raw.cycle_last = tk->tkr_mono.cycle_last; in tk_setup_internals()
268 tk->cycle_interval = interval; in tk_setup_internals()
271 tk->xtime_interval = (u64) interval * clock->mult; in tk_setup_internals()
272 tk->xtime_remainder = ntpinterval - tk->xtime_interval; in tk_setup_internals()
273 tk->raw_interval = in tk_setup_internals()
280 tk->tkr_mono.xtime_nsec >>= -shift_change; in tk_setup_internals()
282 tk->tkr_mono.xtime_nsec <<= shift_change; in tk_setup_internals()
284 tk->tkr_raw.xtime_nsec = 0; in tk_setup_internals()
286 tk->tkr_mono.shift = clock->shift; in tk_setup_internals()
287 tk->tkr_raw.shift = clock->shift; in tk_setup_internals()
289 tk->ntp_error = 0; in tk_setup_internals()
290 tk->ntp_error_shift = NTP_SCALE_SHIFT - clock->shift; in tk_setup_internals()
291 tk->ntp_tick = ntpinterval << tk->ntp_error_shift; in tk_setup_internals()
298 tk->tkr_mono.mult = clock->mult; in tk_setup_internals()
299 tk->tkr_raw.mult = clock->mult; in tk_setup_internals()
300 tk->ntp_err_mult = 0; in tk_setup_internals()
458 static void halt_fast_timekeeper(struct timekeeper *tk) in halt_fast_timekeeper() argument
461 struct tk_read_base *tkr = &tk->tkr_mono; in halt_fast_timekeeper()
468 tkr = &tk->tkr_raw; in halt_fast_timekeeper()
476 static inline void update_vsyscall(struct timekeeper *tk) in update_vsyscall() argument
480 xt = timespec64_to_timespec(tk_xtime(tk)); in update_vsyscall()
481 wm = timespec64_to_timespec(tk->wall_to_monotonic); in update_vsyscall()
482 update_vsyscall_old(&xt, &wm, tk->tkr_mono.clock, tk->tkr_mono.mult, in update_vsyscall()
483 tk->tkr_mono.cycle_last); in update_vsyscall()
486 static inline void old_vsyscall_fixup(struct timekeeper *tk) in old_vsyscall_fixup() argument
500 remainder = tk->tkr_mono.xtime_nsec & ((1ULL << tk->tkr_mono.shift) - 1); in old_vsyscall_fixup()
501 tk->tkr_mono.xtime_nsec -= remainder; in old_vsyscall_fixup()
502 tk->tkr_mono.xtime_nsec += 1ULL << tk->tkr_mono.shift; in old_vsyscall_fixup()
503 tk->ntp_error += remainder << tk->ntp_error_shift; in old_vsyscall_fixup()
504 tk->ntp_error -= (1ULL << tk->tkr_mono.shift) << tk->ntp_error_shift; in old_vsyscall_fixup()
507 #define old_vsyscall_fixup(tk) argument
512 static void update_pvclock_gtod(struct timekeeper *tk, bool was_set) in update_pvclock_gtod() argument
514 raw_notifier_call_chain(&pvclock_gtod_chain, was_set, tk); in update_pvclock_gtod()
522 struct timekeeper *tk = &tk_core.timekeeper; in pvclock_gtod_register_notifier() local
528 update_pvclock_gtod(tk, true); in pvclock_gtod_register_notifier()
555 static inline void tk_update_ktime_data(struct timekeeper *tk) in tk_update_ktime_data() argument
567 seconds = (u64)(tk->xtime_sec + tk->wall_to_monotonic.tv_sec); in tk_update_ktime_data()
568 nsec = (u32) tk->wall_to_monotonic.tv_nsec; in tk_update_ktime_data()
569 tk->tkr_mono.base = ns_to_ktime(seconds * NSEC_PER_SEC + nsec); in tk_update_ktime_data()
572 tk->tkr_raw.base = timespec64_to_ktime(tk->raw_time); in tk_update_ktime_data()
579 nsec += (u32)(tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift); in tk_update_ktime_data()
582 tk->ktime_sec = seconds; in tk_update_ktime_data()
586 static void timekeeping_update(struct timekeeper *tk, unsigned int action) in timekeeping_update() argument
589 tk->ntp_error = 0; in timekeeping_update()
593 tk_update_ktime_data(tk); in timekeeping_update()
595 update_vsyscall(tk); in timekeeping_update()
596 update_pvclock_gtod(tk, action & TK_CLOCK_WAS_SET); in timekeeping_update()
602 update_fast_timekeeper(&tk->tkr_mono, &tk_fast_mono); in timekeeping_update()
603 update_fast_timekeeper(&tk->tkr_raw, &tk_fast_raw); in timekeeping_update()
613 static void timekeeping_forward_now(struct timekeeper *tk) in timekeeping_forward_now() argument
615 struct clocksource *clock = tk->tkr_mono.clock; in timekeeping_forward_now()
619 cycle_now = tk->tkr_mono.read(clock); in timekeeping_forward_now()
620 delta = clocksource_delta(cycle_now, tk->tkr_mono.cycle_last, tk->tkr_mono.mask); in timekeeping_forward_now()
621 tk->tkr_mono.cycle_last = cycle_now; in timekeeping_forward_now()
622 tk->tkr_raw.cycle_last = cycle_now; in timekeeping_forward_now()
624 tk->tkr_mono.xtime_nsec += delta * tk->tkr_mono.mult; in timekeeping_forward_now()
627 tk->tkr_mono.xtime_nsec += (u64)arch_gettimeoffset() << tk->tkr_mono.shift; in timekeeping_forward_now()
629 tk_normalize_xtime(tk); in timekeeping_forward_now()
631 nsec = clocksource_cyc2ns(delta, tk->tkr_raw.mult, tk->tkr_raw.shift); in timekeeping_forward_now()
632 timespec64_add_ns(&tk->raw_time, nsec); in timekeeping_forward_now()
644 struct timekeeper *tk = &tk_core.timekeeper; in __getnstimeofday64() local
651 ts->tv_sec = tk->xtime_sec; in __getnstimeofday64()
652 nsecs = timekeeping_get_ns(&tk->tkr_mono); in __getnstimeofday64()
683 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get() local
692 base = tk->tkr_mono.base; in ktime_get()
693 nsecs = timekeeping_get_ns(&tk->tkr_mono); in ktime_get()
709 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_with_offset() local
718 base = ktime_add(tk->tkr_mono.base, *offset); in ktime_get_with_offset()
719 nsecs = timekeeping_get_ns(&tk->tkr_mono); in ktime_get_with_offset()
753 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_raw() local
760 base = tk->tkr_raw.base; in ktime_get_raw()
761 nsecs = timekeeping_get_ns(&tk->tkr_raw); in ktime_get_raw()
779 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_ts64() local
788 ts->tv_sec = tk->xtime_sec; in ktime_get_ts64()
789 nsec = timekeeping_get_ns(&tk->tkr_mono); in ktime_get_ts64()
790 tomono = tk->wall_to_monotonic; in ktime_get_ts64()
811 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_seconds() local
814 return tk->ktime_sec; in ktime_get_seconds()
831 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_real_seconds() local
836 return tk->xtime_sec; in ktime_get_real_seconds()
840 seconds = tk->xtime_sec; in ktime_get_real_seconds()
861 struct timekeeper *tk = &tk_core.timekeeper; in getnstime_raw_and_real() local
870 *ts_raw = timespec64_to_timespec(tk->raw_time); in getnstime_raw_and_real()
871 ts_real->tv_sec = tk->xtime_sec; in getnstime_raw_and_real()
874 nsecs_raw = timekeeping_get_ns(&tk->tkr_raw); in getnstime_raw_and_real()
875 nsecs_real = timekeeping_get_ns(&tk->tkr_mono); in getnstime_raw_and_real()
910 struct timekeeper *tk = &tk_core.timekeeper; in do_settimeofday64() local
920 timekeeping_forward_now(tk); in do_settimeofday64()
922 xt = tk_xtime(tk); in do_settimeofday64()
926 tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, ts_delta)); in do_settimeofday64()
928 tk_set_xtime(tk, ts); in do_settimeofday64()
930 timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET); in do_settimeofday64()
950 struct timekeeper *tk = &tk_core.timekeeper; in timekeeping_inject_offset() local
963 timekeeping_forward_now(tk); in timekeeping_inject_offset()
966 tmp = timespec64_add(tk_xtime(tk), ts64); in timekeeping_inject_offset()
972 tk_xtime_add(tk, &ts64); in timekeeping_inject_offset()
973 tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, ts64)); in timekeeping_inject_offset()
976 timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET); in timekeeping_inject_offset()
995 struct timekeeper *tk = &tk_core.timekeeper; in timekeeping_get_tai_offset() local
1001 ret = tk->tai_offset; in timekeeping_get_tai_offset()
1011 static void __timekeeping_set_tai_offset(struct timekeeper *tk, s32 tai_offset) in __timekeeping_set_tai_offset() argument
1013 tk->tai_offset = tai_offset; in __timekeeping_set_tai_offset()
1014 tk->offs_tai = ktime_add(tk->offs_real, ktime_set(tai_offset, 0)); in __timekeeping_set_tai_offset()
1023 struct timekeeper *tk = &tk_core.timekeeper; in timekeeping_set_tai_offset() local
1028 __timekeeping_set_tai_offset(tk, tai_offset); in timekeeping_set_tai_offset()
1029 timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET); in timekeeping_set_tai_offset()
1042 struct timekeeper *tk = &tk_core.timekeeper; in change_clocksource() local
1051 timekeeping_forward_now(tk); in change_clocksource()
1058 old = tk->tkr_mono.clock; in change_clocksource()
1059 tk_setup_internals(tk, new); in change_clocksource()
1067 timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET); in change_clocksource()
1084 struct timekeeper *tk = &tk_core.timekeeper; in timekeeping_notify() local
1086 if (tk->tkr_mono.clock == clock) in timekeeping_notify()
1090 return tk->tkr_mono.clock == clock ? 0 : -1; in timekeeping_notify()
1101 struct timekeeper *tk = &tk_core.timekeeper; in getrawmonotonic64() local
1108 nsecs = timekeeping_get_ns(&tk->tkr_raw); in getrawmonotonic64()
1109 ts64 = tk->raw_time; in getrawmonotonic64()
1124 struct timekeeper *tk = &tk_core.timekeeper; in timekeeping_valid_for_hres() local
1131 ret = tk->tkr_mono.clock->flags & CLOCK_SOURCE_VALID_FOR_HRES; in timekeeping_valid_for_hres()
1143 struct timekeeper *tk = &tk_core.timekeeper; in timekeeping_max_deferment() local
1150 ret = tk->tkr_mono.clock->max_idle_ns; in timekeeping_max_deferment()
1214 struct timekeeper *tk = &tk_core.timekeeper; in timekeeping_init() local
1243 tk_setup_internals(tk, clock); in timekeeping_init()
1245 tk_set_xtime(tk, &now); in timekeeping_init()
1246 tk->raw_time.tv_sec = 0; in timekeeping_init()
1247 tk->raw_time.tv_nsec = 0; in timekeeping_init()
1249 boot = tk_xtime(tk); in timekeeping_init()
1252 tk_set_wall_to_mono(tk, tmp); in timekeeping_init()
1254 timekeeping_update(tk, TK_MIRROR); in timekeeping_init()
1270 static void __timekeeping_inject_sleeptime(struct timekeeper *tk, in __timekeeping_inject_sleeptime() argument
1279 tk_xtime_add(tk, delta); in __timekeeping_inject_sleeptime()
1280 tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, *delta)); in __timekeeping_inject_sleeptime()
1281 tk_update_sleep_time(tk, timespec64_to_ktime(*delta)); in __timekeeping_inject_sleeptime()
1334 struct timekeeper *tk = &tk_core.timekeeper; in timekeeping_inject_sleeptime64() local
1340 timekeeping_forward_now(tk); in timekeeping_inject_sleeptime64()
1342 __timekeeping_inject_sleeptime(tk, delta); in timekeeping_inject_sleeptime64()
1344 timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET); in timekeeping_inject_sleeptime64()
1359 struct timekeeper *tk = &tk_core.timekeeper; in timekeeping_resume() local
1360 struct clocksource *clock = tk->tkr_mono.clock; in timekeeping_resume()
1386 cycle_now = tk->tkr_mono.read(clock); in timekeeping_resume()
1388 cycle_now > tk->tkr_mono.cycle_last) { in timekeeping_resume()
1394 cycle_delta = clocksource_delta(cycle_now, tk->tkr_mono.cycle_last, in timekeeping_resume()
1395 tk->tkr_mono.mask); in timekeeping_resume()
1418 __timekeeping_inject_sleeptime(tk, &ts_delta); in timekeeping_resume()
1421 tk->tkr_mono.cycle_last = cycle_now; in timekeeping_resume()
1422 tk->tkr_raw.cycle_last = cycle_now; in timekeeping_resume()
1424 tk->ntp_error = 0; in timekeeping_resume()
1426 timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET); in timekeeping_resume()
1438 struct timekeeper *tk = &tk_core.timekeeper; in timekeeping_suspend() local
1455 timekeeping_forward_now(tk); in timekeeping_suspend()
1465 delta = timespec64_sub(tk_xtime(tk), timekeeping_suspend_time); in timekeeping_suspend()
1480 timekeeping_update(tk, TK_MIRROR); in timekeeping_suspend()
1481 halt_fast_timekeeper(tk); in timekeeping_suspend()
1508 static __always_inline void timekeeping_apply_adjustment(struct timekeeper *tk, in timekeeping_apply_adjustment() argument
1513 s64 interval = tk->cycle_interval; in timekeeping_apply_adjustment()
1574 if ((mult_adj > 0) && (tk->tkr_mono.mult + mult_adj < mult_adj)) { in timekeeping_apply_adjustment()
1580 tk->tkr_mono.mult += mult_adj; in timekeeping_apply_adjustment()
1581 tk->xtime_interval += interval; in timekeeping_apply_adjustment()
1582 tk->tkr_mono.xtime_nsec -= offset; in timekeeping_apply_adjustment()
1583 tk->ntp_error -= (interval - offset) << tk->ntp_error_shift; in timekeeping_apply_adjustment()
1590 static __always_inline void timekeeping_freqadjust(struct timekeeper *tk, in timekeeping_freqadjust() argument
1593 s64 interval = tk->cycle_interval; in timekeeping_freqadjust()
1594 s64 xinterval = tk->xtime_interval; in timekeeping_freqadjust()
1600 if (tk->ntp_err_mult) in timekeeping_freqadjust()
1601 xinterval -= tk->cycle_interval; in timekeeping_freqadjust()
1603 tk->ntp_tick = ntp_tick_length(); in timekeeping_freqadjust()
1606 tick_error = ntp_tick_length() >> tk->ntp_error_shift; in timekeeping_freqadjust()
1607 tick_error -= (xinterval + tk->xtime_remainder); in timekeeping_freqadjust()
1622 timekeeping_apply_adjustment(tk, offset, negative, adj); in timekeeping_freqadjust()
1629 static void timekeeping_adjust(struct timekeeper *tk, s64 offset) in timekeeping_adjust() argument
1632 timekeeping_freqadjust(tk, offset); in timekeeping_adjust()
1635 if (!tk->ntp_err_mult && (tk->ntp_error > 0)) { in timekeeping_adjust()
1636 tk->ntp_err_mult = 1; in timekeeping_adjust()
1637 timekeeping_apply_adjustment(tk, offset, 0, 0); in timekeeping_adjust()
1638 } else if (tk->ntp_err_mult && (tk->ntp_error <= 0)) { in timekeeping_adjust()
1640 timekeeping_apply_adjustment(tk, offset, 1, 0); in timekeeping_adjust()
1641 tk->ntp_err_mult = 0; in timekeeping_adjust()
1644 if (unlikely(tk->tkr_mono.clock->maxadj && in timekeeping_adjust()
1645 (abs(tk->tkr_mono.mult - tk->tkr_mono.clock->mult) in timekeeping_adjust()
1646 > tk->tkr_mono.clock->maxadj))) { in timekeeping_adjust()
1649 tk->tkr_mono.clock->name, (long)tk->tkr_mono.mult, in timekeeping_adjust()
1650 (long)tk->tkr_mono.clock->mult + tk->tkr_mono.clock->maxadj); in timekeeping_adjust()
1667 if (unlikely((s64)tk->tkr_mono.xtime_nsec < 0)) { in timekeeping_adjust()
1668 s64 neg = -(s64)tk->tkr_mono.xtime_nsec; in timekeeping_adjust()
1669 tk->tkr_mono.xtime_nsec = 0; in timekeeping_adjust()
1670 tk->ntp_error += neg << tk->ntp_error_shift; in timekeeping_adjust()
1682 static inline unsigned int accumulate_nsecs_to_secs(struct timekeeper *tk) in accumulate_nsecs_to_secs() argument
1684 u64 nsecps = (u64)NSEC_PER_SEC << tk->tkr_mono.shift; in accumulate_nsecs_to_secs()
1687 while (tk->tkr_mono.xtime_nsec >= nsecps) { in accumulate_nsecs_to_secs()
1690 tk->tkr_mono.xtime_nsec -= nsecps; in accumulate_nsecs_to_secs()
1691 tk->xtime_sec++; in accumulate_nsecs_to_secs()
1694 leap = second_overflow(tk->xtime_sec); in accumulate_nsecs_to_secs()
1698 tk->xtime_sec += leap; in accumulate_nsecs_to_secs()
1702 tk_set_wall_to_mono(tk, in accumulate_nsecs_to_secs()
1703 timespec64_sub(tk->wall_to_monotonic, ts)); in accumulate_nsecs_to_secs()
1705 __timekeeping_set_tai_offset(tk, tk->tai_offset - leap); in accumulate_nsecs_to_secs()
1722 static cycle_t logarithmic_accumulation(struct timekeeper *tk, cycle_t offset, in logarithmic_accumulation() argument
1726 cycle_t interval = tk->cycle_interval << shift; in logarithmic_accumulation()
1735 tk->tkr_mono.cycle_last += interval; in logarithmic_accumulation()
1736 tk->tkr_raw.cycle_last += interval; in logarithmic_accumulation()
1738 tk->tkr_mono.xtime_nsec += tk->xtime_interval << shift; in logarithmic_accumulation()
1739 *clock_set |= accumulate_nsecs_to_secs(tk); in logarithmic_accumulation()
1742 raw_nsecs = (u64)tk->raw_interval << shift; in logarithmic_accumulation()
1743 raw_nsecs += tk->raw_time.tv_nsec; in logarithmic_accumulation()
1747 tk->raw_time.tv_sec += raw_secs; in logarithmic_accumulation()
1749 tk->raw_time.tv_nsec = raw_nsecs; in logarithmic_accumulation()
1752 tk->ntp_error += tk->ntp_tick << shift; in logarithmic_accumulation()
1753 tk->ntp_error -= (tk->xtime_interval + tk->xtime_remainder) << in logarithmic_accumulation()
1754 (tk->ntp_error_shift + shift); in logarithmic_accumulation()
1766 struct timekeeper *tk = &shadow_timekeeper; in update_wall_time() local
1781 offset = clocksource_delta(tk->tkr_mono.read(tk->tkr_mono.clock), in update_wall_time()
1782 tk->tkr_mono.cycle_last, tk->tkr_mono.mask); in update_wall_time()
1800 shift = ilog2(offset) - ilog2(tk->cycle_interval); in update_wall_time()
1805 while (offset >= tk->cycle_interval) { in update_wall_time()
1806 offset = logarithmic_accumulation(tk, offset, shift, in update_wall_time()
1808 if (offset < tk->cycle_interval<<shift) in update_wall_time()
1813 timekeeping_adjust(tk, offset); in update_wall_time()
1819 old_vsyscall_fixup(tk); in update_wall_time()
1825 clock_set |= accumulate_nsecs_to_secs(tk); in update_wall_time()
1838 memcpy(real_tk, tk, sizeof(*tk)); in update_wall_time()
1861 struct timekeeper *tk = &tk_core.timekeeper; in getboottime64() local
1862 ktime_t t = ktime_sub(tk->offs_real, tk->offs_boot); in getboottime64()
1870 struct timekeeper *tk = &tk_core.timekeeper; in get_seconds() local
1872 return tk->xtime_sec; in get_seconds()
1878 struct timekeeper *tk = &tk_core.timekeeper; in __current_kernel_time() local
1880 return timespec64_to_timespec(tk_xtime(tk)); in __current_kernel_time()
1885 struct timekeeper *tk = &tk_core.timekeeper; in current_kernel_time() local
1892 now = tk_xtime(tk); in current_kernel_time()
1901 struct timekeeper *tk = &tk_core.timekeeper; in get_monotonic_coarse64() local
1908 now = tk_xtime(tk); in get_monotonic_coarse64()
1909 mono = tk->wall_to_monotonic; in get_monotonic_coarse64()
1938 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_update_offsets_tick() local
1946 base = tk->tkr_mono.base; in ktime_get_update_offsets_tick()
1947 nsecs = tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift; in ktime_get_update_offsets_tick()
1949 *offs_real = tk->offs_real; in ktime_get_update_offsets_tick()
1950 *offs_boot = tk->offs_boot; in ktime_get_update_offsets_tick()
1951 *offs_tai = tk->offs_tai; in ktime_get_update_offsets_tick()
1970 struct timekeeper *tk = &tk_core.timekeeper; in ktime_get_update_offsets_now() local
1978 base = tk->tkr_mono.base; in ktime_get_update_offsets_now()
1979 nsecs = timekeeping_get_ns(&tk->tkr_mono); in ktime_get_update_offsets_now()
1981 *offs_real = tk->offs_real; in ktime_get_update_offsets_now()
1982 *offs_boot = tk->offs_boot; in ktime_get_update_offsets_now()
1983 *offs_tai = tk->offs_tai; in ktime_get_update_offsets_now()
1995 struct timekeeper *tk = &tk_core.timekeeper; in do_adjtimex() local
2022 orig_tai = tai = tk->tai_offset; in do_adjtimex()
2026 __timekeeping_set_tai_offset(tk, tai); in do_adjtimex()
2027 timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET); in do_adjtimex()