diff options
author | John Stultz <john.stultz@linaro.org> | 2014-12-08 15:00:09 -0500 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2015-01-23 20:21:54 -0500 |
commit | d08c0cdd26d48751c15aa2b4479a410594fee9ac (patch) | |
tree | 8cba7b361ac9e8cdc99d2b167ba5317c679a8e74 /kernel | |
parent | 8b618628b2bf83512fc8df5e8672619d65adfdfb (diff) |
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 'kernel')
-rw-r--r-- | kernel/time/timekeeping.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 6a931852082f..b124af259800 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -1659,24 +1659,24 @@ out: | |||
1659 | } | 1659 | } |
1660 | 1660 | ||
1661 | /** | 1661 | /** |
1662 | * getboottime - Return the real time of system boot. | 1662 | * getboottime64 - Return the real time of system boot. |
1663 | * @ts: pointer to the timespec to be set | 1663 | * @ts: pointer to the timespec64 to be set |
1664 | * | 1664 | * |
1665 | * Returns the wall-time of boot in a timespec. | 1665 | * Returns the wall-time of boot in a timespec64. |
1666 | * | 1666 | * |
1667 | * This is based on the wall_to_monotonic offset and the total suspend | 1667 | * This is based on the wall_to_monotonic offset and the total suspend |
1668 | * time. Calls to settimeofday will affect the value returned (which | 1668 | * time. Calls to settimeofday will affect the value returned (which |
1669 | * basically means that however wrong your real time clock is at boot time, | 1669 | * basically means that however wrong your real time clock is at boot time, |
1670 | * you get the right time here). | 1670 | * you get the right time here). |
1671 | */ | 1671 | */ |
1672 | void getboottime(struct timespec *ts) | 1672 | void getboottime64(struct timespec64 *ts) |
1673 | { | 1673 | { |
1674 | struct timekeeper *tk = &tk_core.timekeeper; | 1674 | struct timekeeper *tk = &tk_core.timekeeper; |
1675 | ktime_t t = ktime_sub(tk->offs_real, tk->offs_boot); | 1675 | ktime_t t = ktime_sub(tk->offs_real, tk->offs_boot); |
1676 | 1676 | ||
1677 | *ts = ktime_to_timespec(t); | 1677 | *ts = ktime_to_timespec64(t); |
1678 | } | 1678 | } |
1679 | EXPORT_SYMBOL_GPL(getboottime); | 1679 | EXPORT_SYMBOL_GPL(getboottime64); |
1680 | 1680 | ||
1681 | unsigned long get_seconds(void) | 1681 | unsigned long get_seconds(void) |
1682 | { | 1682 | { |