blob: 543beba096c757438415641249040f8090219674 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Thomas Gleixner8b094cd2014-07-16 21:04:02 +00002#ifndef _KERNEL_TIME_TIMEKEEPING_H
3#define _KERNEL_TIME_TIMEKEEPING_H
4/*
5 * Internal interfaces for kernel/time/
6 */
Thomas Gleixner868a3e92015-04-14 21:08:37 +00007extern ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq,
8 ktime_t *offs_real,
Thomas Gleixnera3ed0e432018-04-25 15:33:38 +02009 ktime_t *offs_boot,
Thomas Gleixner868a3e92015-04-14 21:08:37 +000010 ktime_t *offs_tai);
Thomas Gleixner8b094cd2014-07-16 21:04:02 +000011
12extern int timekeeping_valid_for_hres(void);
13extern u64 timekeeping_max_deferment(void);
Arnd Bergmanne0956dc2017-10-19 13:14:44 +020014extern void timekeeping_warp_clock(void);
Rafael J. Wysocki124cf9112015-02-13 23:50:43 +010015extern int timekeeping_suspend(void);
16extern void timekeeping_resume(void);
Chang-An Chen3f2552f2019-03-29 10:59:09 +080017#ifdef CONFIG_GENERIC_SCHED_CLOCK
18extern int sched_clock_suspend(void);
19extern void sched_clock_resume(void);
20#else
21static inline int sched_clock_suspend(void) { return 0; }
22static inline void sched_clock_resume(void) { }
23#endif
Thomas Gleixner8b094cd2014-07-16 21:04:02 +000024
Arnd Bergmann56cc7b82020-09-24 17:39:11 +020025extern void update_process_times(int user);
Thomas Gleixnerbfb83b22015-03-25 13:06:04 +010026extern void do_timer(unsigned long ticks);
27extern void update_wall_time(void);
28
Thomas Gleixnere5d4d172020-03-21 12:25:58 +010029extern raw_spinlock_t jiffies_lock;
Davidlohr Bueso1a2b85f2020-10-21 12:07:49 -070030extern seqcount_raw_spinlock_t jiffies_seq;
Thomas Gleixnerbfb83b22015-03-25 13:06:04 +010031
32#define CS_NAME_LEN 32
33
Thomas Gleixner8b094cd2014-07-16 21:04:02 +000034#endif