xref: /linux/kernel/time/ntp_internal.h (revision f4cdf7ca9a1fdcca413157df19753f388a5a224e)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_NTP_INTERNAL_H
3 #define _LINUX_NTP_INTERNAL_H
4 
5 extern void ntp_init(void);
6 extern void ntp_clear(unsigned int tkid, s64 cs_tick_adj);
7 /* Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. */
8 extern u64 ntp_tick_length(unsigned int tkid);
9 extern s64 ntp_get_skew_delta(unsigned int tkid);
10 extern s64 ntp_drain_skew(unsigned int tkid, s64 amount, unsigned int shift);
11 extern ktime_t ntp_get_next_leap(unsigned int tkid);
12 extern int second_overflow(unsigned int tkid, time64_t secs);
13 extern int ntp_adjtimex(unsigned int tkid, struct __kernel_timex *txc, const struct timespec64 *ts,
14 			s32 *time_tai, struct audit_ntp_data *ad);
15 extern void __hardpps(const struct timespec64 *phase_ts, const struct timespec64 *raw_ts);
16 
17 #if defined(CONFIG_GENERIC_CMOS_UPDATE) || defined(CONFIG_RTC_SYSTOHC)
18 extern void ntp_notify_cmos_timer(bool offset_set);
19 #else
20 static inline void ntp_notify_cmos_timer(bool offset_set) { }
21 #endif
22 
23 #endif /* _LINUX_NTP_INTERNAL_H */
24