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.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 9b63d13ba82b..3eaae4754275 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -33,6 +33,7 @@ extern time64_t ktime_get_real_seconds(void);
33 33
34extern int __getnstimeofday64(struct timespec64 *tv); 34extern int __getnstimeofday64(struct timespec64 *tv);
35extern void getnstimeofday64(struct timespec64 *tv); 35extern void getnstimeofday64(struct timespec64 *tv);
36extern void getboottime64(struct timespec64 *ts);
36 37
37#if BITS_PER_LONG == 64 38#if BITS_PER_LONG == 64
38/** 39/**
@@ -72,6 +73,11 @@ static inline struct timespec get_monotonic_coarse(void)
72{ 73{
73 return get_monotonic_coarse64(); 74 return get_monotonic_coarse64();
74} 75}
76
77static inline void getboottime(struct timespec *ts)
78{
79 return getboottime64(ts);
80}
75#else 81#else
76/** 82/**
77 * Deprecated. Use do_settimeofday64(). 83 * Deprecated. Use do_settimeofday64().
@@ -129,9 +135,15 @@ static inline struct timespec get_monotonic_coarse(void)
129{ 135{
130 return timespec64_to_timespec(get_monotonic_coarse64()); 136 return timespec64_to_timespec(get_monotonic_coarse64());
131} 137}
132#endif
133 138
134extern void getboottime(struct timespec *ts); 139static inline void getboottime(struct timespec *ts)
140{
141 struct timespec64 ts64;
142
143 getboottime64(&ts64);
144 *ts = timespec64_to_timespec(ts64);
145}
146#endif
135 147
136#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) 148#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
137#define ktime_get_real_ts64(ts) getnstimeofday64(ts) 149#define ktime_get_real_ts64(ts) getnstimeofday64(ts)
@@ -217,6 +229,11 @@ static inline void get_monotonic_boottime(struct timespec *ts)
217 *ts = ktime_to_timespec(ktime_get_boottime()); 229 *ts = ktime_to_timespec(ktime_get_boottime());
218} 230}
219 231
232static inline void get_monotonic_boottime64(struct timespec64 *ts)
233{
234 *ts = ktime_to_timespec64(ktime_get_boottime());
235}
236
220static inline void timekeeping_clocktai(struct timespec *ts) 237static inline void timekeeping_clocktai(struct timespec *ts)
221{ 238{
222 *ts = ktime_to_timespec(ktime_get_clocktai()); 239 *ts = ktime_to_timespec(ktime_get_clocktai());