Arnd Bergmann | 6546911 | 2017-10-19 13:14:49 +0200 | [diff] [blame] | 1 | #ifndef _LINUX_TIMEKEEPING32_H |
| 2 | #define _LINUX_TIMEKEEPING32_H |
| 3 | /* |
| 4 | * These interfaces are all based on the old timespec type |
| 5 | * and should get replaced with the timespec64 based versions |
| 6 | * over time so we can remove the file here. |
| 7 | */ |
| 8 | |
| 9 | extern void do_gettimeofday(struct timeval *tv); |
| 10 | unsigned long get_seconds(void); |
| 11 | |
Arnd Bergmann | 6546911 | 2017-10-19 13:14:49 +0200 | [diff] [blame] | 12 | static inline void getnstimeofday(struct timespec *ts) |
| 13 | { |
| 14 | struct timespec64 ts64; |
| 15 | |
Arnd Bergmann | edca71f | 2018-04-27 15:40:13 +0200 | [diff] [blame] | 16 | ktime_get_real_ts64(&ts64); |
Arnd Bergmann | 6546911 | 2017-10-19 13:14:49 +0200 | [diff] [blame] | 17 | *ts = timespec64_to_timespec(ts64); |
| 18 | } |
| 19 | |
| 20 | static inline void ktime_get_ts(struct timespec *ts) |
| 21 | { |
| 22 | struct timespec64 ts64; |
| 23 | |
| 24 | ktime_get_ts64(&ts64); |
| 25 | *ts = timespec64_to_timespec(ts64); |
| 26 | } |
| 27 | |
Arnd Bergmann | 6546911 | 2017-10-19 13:14:49 +0200 | [diff] [blame] | 28 | static inline void getrawmonotonic(struct timespec *ts) |
| 29 | { |
| 30 | struct timespec64 ts64; |
| 31 | |
Arnd Bergmann | fb7fcc9 | 2018-04-27 15:40:14 +0200 | [diff] [blame] | 32 | ktime_get_raw_ts64(&ts64); |
Arnd Bergmann | 6546911 | 2017-10-19 13:14:49 +0200 | [diff] [blame] | 33 | *ts = timespec64_to_timespec(ts64); |
| 34 | } |
| 35 | |
Arnd Bergmann | 6546911 | 2017-10-19 13:14:49 +0200 | [diff] [blame] | 36 | static inline void getboottime(struct timespec *ts) |
| 37 | { |
| 38 | struct timespec64 ts64; |
| 39 | |
| 40 | getboottime64(&ts64); |
| 41 | *ts = timespec64_to_timespec(ts64); |
| 42 | } |
Arnd Bergmann | 6546911 | 2017-10-19 13:14:49 +0200 | [diff] [blame] | 43 | |
| 44 | /* |
Arnd Bergmann | 6546911 | 2017-10-19 13:14:49 +0200 | [diff] [blame] | 45 | * Persistent clock related interfaces |
| 46 | */ |
| 47 | extern void read_persistent_clock(struct timespec *ts); |
| 48 | extern int update_persistent_clock(struct timespec now); |
| 49 | |
| 50 | #endif |