Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Thomas Gleixner | 8b094cd | 2014-07-16 21:04:02 +0000 | [diff] [blame] | 2 | #ifndef _KERNEL_TIME_TIMEKEEPING_H |
| 3 | #define _KERNEL_TIME_TIMEKEEPING_H |
| 4 | /* |
| 5 | * Internal interfaces for kernel/time/ |
| 6 | */ |
Thomas Gleixner | 868a3e9 | 2015-04-14 21:08:37 +0000 | [diff] [blame] | 7 | extern ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq, |
| 8 | ktime_t *offs_real, |
Thomas Gleixner | a3ed0e43 | 2018-04-25 15:33:38 +0200 | [diff] [blame] | 9 | ktime_t *offs_boot, |
Thomas Gleixner | 868a3e9 | 2015-04-14 21:08:37 +0000 | [diff] [blame] | 10 | ktime_t *offs_tai); |
Thomas Gleixner | 8b094cd | 2014-07-16 21:04:02 +0000 | [diff] [blame] | 11 | |
| 12 | extern int timekeeping_valid_for_hres(void); |
| 13 | extern u64 timekeeping_max_deferment(void); |
Arnd Bergmann | e0956dc | 2017-10-19 13:14:44 +0200 | [diff] [blame] | 14 | extern void timekeeping_warp_clock(void); |
Rafael J. Wysocki | 124cf911 | 2015-02-13 23:50:43 +0100 | [diff] [blame] | 15 | extern int timekeeping_suspend(void); |
| 16 | extern void timekeeping_resume(void); |
Chang-An Chen | 3f2552f | 2019-03-29 10:59:09 +0800 | [diff] [blame] | 17 | #ifdef CONFIG_GENERIC_SCHED_CLOCK |
| 18 | extern int sched_clock_suspend(void); |
| 19 | extern void sched_clock_resume(void); |
| 20 | #else |
| 21 | static inline int sched_clock_suspend(void) { return 0; } |
| 22 | static inline void sched_clock_resume(void) { } |
| 23 | #endif |
Thomas Gleixner | 8b094cd | 2014-07-16 21:04:02 +0000 | [diff] [blame] | 24 | |
Arnd Bergmann | 56cc7b8 | 2020-09-24 17:39:11 +0200 | [diff] [blame] | 25 | extern void update_process_times(int user); |
Thomas Gleixner | bfb83b2 | 2015-03-25 13:06:04 +0100 | [diff] [blame] | 26 | extern void do_timer(unsigned long ticks); |
| 27 | extern void update_wall_time(void); |
| 28 | |
Thomas Gleixner | e5d4d17 | 2020-03-21 12:25:58 +0100 | [diff] [blame] | 29 | extern raw_spinlock_t jiffies_lock; |
Davidlohr Bueso | 1a2b85f | 2020-10-21 12:07:49 -0700 | [diff] [blame] | 30 | extern seqcount_raw_spinlock_t jiffies_seq; |
Thomas Gleixner | bfb83b2 | 2015-03-25 13:06:04 +0100 | [diff] [blame] | 31 | |
| 32 | #define CS_NAME_LEN 32 |
| 33 | |
Thomas Gleixner | 8b094cd | 2014-07-16 21:04:02 +0000 | [diff] [blame] | 34 | #endif |