aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/timekeeping.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/timekeeping.h')
-rw-r--r--include/linux/timekeeping.h49
1 files changed, 45 insertions, 4 deletions
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 1caa6b04fdc5..961fea373f83 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -10,7 +10,7 @@ extern int timekeeping_suspended;
10 * Get and set timeofday 10 * Get and set timeofday
11 */ 11 */
12extern void do_gettimeofday(struct timeval *tv); 12extern void do_gettimeofday(struct timeval *tv);
13extern int do_settimeofday(const struct timespec *tv); 13extern int do_settimeofday64(const struct timespec64 *ts);
14extern int do_sys_settimeofday(const struct timespec *tv, 14extern int do_sys_settimeofday(const struct timespec *tv,
15 const struct timezone *tz); 15 const struct timezone *tz);
16 16
@@ -25,14 +25,22 @@ struct timespec __current_kernel_time(void);
25/* 25/*
26 * timespec based interfaces 26 * timespec based interfaces
27 */ 27 */
28struct timespec get_monotonic_coarse(void); 28struct timespec64 get_monotonic_coarse64(void);
29extern void getrawmonotonic(struct timespec *ts); 29extern void getrawmonotonic64(struct timespec64 *ts);
30extern void ktime_get_ts64(struct timespec64 *ts); 30extern void ktime_get_ts64(struct timespec64 *ts);
31 31
32extern int __getnstimeofday64(struct timespec64 *tv); 32extern int __getnstimeofday64(struct timespec64 *tv);
33extern void getnstimeofday64(struct timespec64 *tv); 33extern void getnstimeofday64(struct timespec64 *tv);
34 34
35#if BITS_PER_LONG == 64 35#if BITS_PER_LONG == 64
36/**
37 * Deprecated. Use do_settimeofday64().
38 */
39static inline int do_settimeofday(const struct timespec *ts)
40{
41 return do_settimeofday64(ts);
42}
43
36static inline int __getnstimeofday(struct timespec *ts) 44static inline int __getnstimeofday(struct timespec *ts)
37{ 45{
38 return __getnstimeofday64(ts); 46 return __getnstimeofday64(ts);
@@ -53,7 +61,27 @@ static inline void ktime_get_real_ts(struct timespec *ts)
53 getnstimeofday64(ts); 61 getnstimeofday64(ts);
54} 62}
55 63
64static inline void getrawmonotonic(struct timespec *ts)
65{
66 getrawmonotonic64(ts);
67}
68
69static inline struct timespec get_monotonic_coarse(void)
70{
71 return get_monotonic_coarse64();
72}
56#else 73#else
74/**
75 * Deprecated. Use do_settimeofday64().
76 */
77static inline int do_settimeofday(const struct timespec *ts)
78{
79 struct timespec64 ts64;
80
81 ts64 = timespec_to_timespec64(*ts);
82 return do_settimeofday64(&ts64);
83}
84
57static inline int __getnstimeofday(struct timespec *ts) 85static inline int __getnstimeofday(struct timespec *ts)
58{ 86{
59 struct timespec64 ts64; 87 struct timespec64 ts64;
@@ -86,6 +114,19 @@ static inline void ktime_get_real_ts(struct timespec *ts)
86 getnstimeofday64(&ts64); 114 getnstimeofday64(&ts64);
87 *ts = timespec64_to_timespec(ts64); 115 *ts = timespec64_to_timespec(ts64);
88} 116}
117
118static inline void getrawmonotonic(struct timespec *ts)
119{
120 struct timespec64 ts64;
121
122 getrawmonotonic64(&ts64);
123 *ts = timespec64_to_timespec(ts64);
124}
125
126static inline struct timespec get_monotonic_coarse(void)
127{
128 return timespec64_to_timespec(get_monotonic_coarse64());
129}
89#endif 130#endif
90 131
91extern void getboottime(struct timespec *ts); 132extern void getboottime(struct timespec *ts);
@@ -182,7 +223,7 @@ static inline void timekeeping_clocktai(struct timespec *ts)
182/* 223/*
183 * RTC specific 224 * RTC specific
184 */ 225 */
185extern void timekeeping_inject_sleeptime(struct timespec *delta); 226extern void timekeeping_inject_sleeptime64(struct timespec64 *delta);
186 227
187/* 228/*
188 * PPS accessor 229 * PPS accessor