xref: /openbmc/linux/kernel/time/timekeeping.h (revision cdd38c5f1ce4398ec58fec95904b75824daab7b5)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
28b094cd0SThomas Gleixner #ifndef _KERNEL_TIME_TIMEKEEPING_H
38b094cd0SThomas Gleixner #define _KERNEL_TIME_TIMEKEEPING_H
48b094cd0SThomas Gleixner /*
58b094cd0SThomas Gleixner  * Internal interfaces for kernel/time/
68b094cd0SThomas Gleixner  */
7868a3e91SThomas Gleixner extern ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq,
8868a3e91SThomas Gleixner 					    ktime_t *offs_real,
9a3ed0e43SThomas Gleixner 					    ktime_t *offs_boot,
108b094cd0SThomas Gleixner 					    ktime_t *offs_tai);
118b094cd0SThomas Gleixner 
128b094cd0SThomas Gleixner extern int timekeeping_valid_for_hres(void);
138b094cd0SThomas Gleixner extern u64 timekeeping_max_deferment(void);
14e0956dccSArnd Bergmann extern void timekeeping_warp_clock(void);
15124cf911SRafael J. Wysocki extern int timekeeping_suspend(void);
16124cf911SRafael J. Wysocki extern void timekeeping_resume(void);
173f2552f7SChang-An Chen #ifdef CONFIG_GENERIC_SCHED_CLOCK
183f2552f7SChang-An Chen extern int sched_clock_suspend(void);
193f2552f7SChang-An Chen extern void sched_clock_resume(void);
203f2552f7SChang-An Chen #else
sched_clock_suspend(void)213f2552f7SChang-An Chen static inline int sched_clock_suspend(void) { return 0; }
sched_clock_resume(void)223f2552f7SChang-An Chen static inline void sched_clock_resume(void) { }
233f2552f7SChang-An Chen #endif
248b094cd0SThomas Gleixner 
25*56cc7b8aSArnd Bergmann extern void update_process_times(int user);
26bfb83b27SThomas Gleixner extern void do_timer(unsigned long ticks);
27bfb83b27SThomas Gleixner extern void update_wall_time(void);
28bfb83b27SThomas Gleixner 
29e5d4d175SThomas Gleixner extern raw_spinlock_t jiffies_lock;
301a2b85f1SDavidlohr Bueso extern seqcount_raw_spinlock_t jiffies_seq;
31bfb83b27SThomas Gleixner 
32bfb83b27SThomas Gleixner #define CS_NAME_LEN	32
33bfb83b27SThomas Gleixner 
348b094cd0SThomas Gleixner #endif
35