diff options
author | John Stultz <john.stultz@linaro.org> | 2014-12-08 12:00:09 -0800 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2015-01-23 17:21:54 -0800 |
commit | d08c0cdd26d48751c15aa2b4479a410594fee9ac (patch) | |
tree | 8cba7b361ac9e8cdc99d2b167ba5317c679a8e74 /include/linux/timekeeping.h | |
parent | 8b618628b2bf83512fc8df5e8672619d65adfdfb (diff) | |
download | linux-d08c0cdd26d48751c15aa2b4479a410594fee9ac.tar.gz linux-d08c0cdd26d48751c15aa2b4479a410594fee9ac.tar.bz2 linux-d08c0cdd26d48751c15aa2b4479a410594fee9ac.zip |
time: Expose getboottime64 for in-kernel uses
Adds a timespec64 based getboottime64() implementation
that can be used as we convert internal users of
getboottime away from using timespecs.
Cc: pang.xunlei <pang.xunlei@linaro.org>
Cc: Arnd Bergmann <arnd.bergmann@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include/linux/timekeeping.h')
-rw-r--r-- | include/linux/timekeeping.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 9b63d13ba82b..91480137aa39 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h @@ -33,6 +33,7 @@ extern time64_t ktime_get_real_seconds(void); extern int __getnstimeofday64(struct timespec64 *tv); extern void getnstimeofday64(struct timespec64 *tv); +extern void getboottime64(struct timespec64 *ts); #if BITS_PER_LONG == 64 /** @@ -72,6 +73,11 @@ static inline struct timespec get_monotonic_coarse(void) { return get_monotonic_coarse64(); } + +static inline void getboottime(struct timespec *ts) +{ + return getboottime64(ts); +} #else /** * Deprecated. Use do_settimeofday64(). @@ -129,9 +135,15 @@ static inline struct timespec get_monotonic_coarse(void) { return timespec64_to_timespec(get_monotonic_coarse64()); } -#endif -extern void getboottime(struct timespec *ts); +static inline void getboottime(struct timespec *ts) +{ + struct timespec64 ts64; + + getboottime64(&ts64); + *ts = timespec64_to_timespec(ts64); +} +#endif #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) #define ktime_get_real_ts64(ts) getnstimeofday64(ts) |