diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-07-16 17:04:57 -0400 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2014-07-23 18:01:47 -0400 |
commit | 48f18fd6addc199f330d838d54fe7b0a0892adaa (patch) | |
tree | 21f3f32df6a8ee014b6df7cd1b2653977df6f046 /kernel/time | |
parent | 250fade8af2ac5dda8d5106ea06738b6f9e768a7 (diff) |
timekeeping: Use ktime_get_boottime() for get_monotonic_boottime()
get_monotonic_boottime() is not used in fast pathes, so the extra
timespec conversion is not problematic.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/timekeeping.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index b35613508725..f63476fb0daf 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -1536,40 +1536,6 @@ void getboottime(struct timespec *ts) | |||
1536 | } | 1536 | } |
1537 | EXPORT_SYMBOL_GPL(getboottime); | 1537 | EXPORT_SYMBOL_GPL(getboottime); |
1538 | 1538 | ||
1539 | /** | ||
1540 | * get_monotonic_boottime - Returns monotonic time since boot | ||
1541 | * @ts: pointer to the timespec to be set | ||
1542 | * | ||
1543 | * Returns the monotonic time since boot in a timespec. | ||
1544 | * | ||
1545 | * This is similar to CLOCK_MONTONIC/ktime_get_ts, but also | ||
1546 | * includes the time spent in suspend. | ||
1547 | */ | ||
1548 | void get_monotonic_boottime(struct timespec *ts) | ||
1549 | { | ||
1550 | struct timekeeper *tk = &tk_core.timekeeper; | ||
1551 | struct timespec64 tomono, sleep, ret; | ||
1552 | s64 nsec; | ||
1553 | unsigned int seq; | ||
1554 | |||
1555 | WARN_ON(timekeeping_suspended); | ||
1556 | |||
1557 | do { | ||
1558 | seq = read_seqcount_begin(&tk_core.seq); | ||
1559 | ret.tv_sec = tk->xtime_sec; | ||
1560 | nsec = timekeeping_get_ns(tk); | ||
1561 | tomono = tk->wall_to_monotonic; | ||
1562 | sleep = tk->total_sleep_time; | ||
1563 | |||
1564 | } while (read_seqcount_retry(&tk_core.seq, seq)); | ||
1565 | |||
1566 | ret.tv_sec += tomono.tv_sec + sleep.tv_sec; | ||
1567 | ret.tv_nsec = 0; | ||
1568 | timespec64_add_ns(&ret, nsec + tomono.tv_nsec + sleep.tv_nsec); | ||
1569 | *ts = timespec64_to_timespec(ret); | ||
1570 | } | ||
1571 | EXPORT_SYMBOL_GPL(get_monotonic_boottime); | ||
1572 | |||
1573 | unsigned long get_seconds(void) | 1539 | unsigned long get_seconds(void) |
1574 | { | 1540 | { |
1575 | struct timekeeper *tk = &tk_core.timekeeper; | 1541 | struct timekeeper *tk = &tk_core.timekeeper; |