diff options
Diffstat (limited to 'include/linux/timekeeping.h')
-rw-r--r-- | include/linux/timekeeping.h | 49 |
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 | */ |
12 | extern void do_gettimeofday(struct timeval *tv); | 12 | extern void do_gettimeofday(struct timeval *tv); |
13 | extern int do_settimeofday(const struct timespec *tv); | 13 | extern int do_settimeofday64(const struct timespec64 *ts); |
14 | extern int do_sys_settimeofday(const struct timespec *tv, | 14 | extern 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 | */ |
28 | struct timespec get_monotonic_coarse(void); | 28 | struct timespec64 get_monotonic_coarse64(void); |
29 | extern void getrawmonotonic(struct timespec *ts); | 29 | extern void getrawmonotonic64(struct timespec64 *ts); |
30 | extern void ktime_get_ts64(struct timespec64 *ts); | 30 | extern void ktime_get_ts64(struct timespec64 *ts); |
31 | 31 | ||
32 | extern int __getnstimeofday64(struct timespec64 *tv); | 32 | extern int __getnstimeofday64(struct timespec64 *tv); |
33 | extern void getnstimeofday64(struct timespec64 *tv); | 33 | extern 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 | */ | ||
39 | static inline int do_settimeofday(const struct timespec *ts) | ||
40 | { | ||
41 | return do_settimeofday64(ts); | ||
42 | } | ||
43 | |||
36 | static inline int __getnstimeofday(struct timespec *ts) | 44 | static 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 | ||
64 | static inline void getrawmonotonic(struct timespec *ts) | ||
65 | { | ||
66 | getrawmonotonic64(ts); | ||
67 | } | ||
68 | |||
69 | static 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 | */ | ||
77 | static 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 | |||
57 | static inline int __getnstimeofday(struct timespec *ts) | 85 | static 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 | |||
118 | static inline void getrawmonotonic(struct timespec *ts) | ||
119 | { | ||
120 | struct timespec64 ts64; | ||
121 | |||
122 | getrawmonotonic64(&ts64); | ||
123 | *ts = timespec64_to_timespec(ts64); | ||
124 | } | ||
125 | |||
126 | static inline struct timespec get_monotonic_coarse(void) | ||
127 | { | ||
128 | return timespec64_to_timespec(get_monotonic_coarse64()); | ||
129 | } | ||
89 | #endif | 130 | #endif |
90 | 131 | ||
91 | extern void getboottime(struct timespec *ts); | 132 | extern 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 | */ |
185 | extern void timekeeping_inject_sleeptime(struct timespec *delta); | 226 | extern void timekeeping_inject_sleeptime64(struct timespec64 *delta); |
186 | 227 | ||
187 | /* | 228 | /* |
188 | * PPS accessor | 229 | * PPS accessor |