timers: Add CLOCK_BOOTTIME hrtimer base
commit70a08cca1227dc31c784ec930099a4417a06e7d0
authorJohn Stultz <john.stultz@linaro.org>
Tue, 15 Feb 2011 18:45:16 +0000 (15 10:45 -0800)
committerJohn Stultz <john.stultz@linaro.org>
Mon, 21 Feb 2011 20:53:08 +0000 (21 12:53 -0800)
treed813ae86435a3104b66d18ee746d0f3ecc73a14a
parent314ac37150011ebb398f522db528d2dbcc611189
timers: Add CLOCK_BOOTTIME hrtimer base

CLOCK_MONOTONIC stops while the system is in suspend. This is because
to applications system suspend is invisible. However, there is a
growing set of applications that are wanting to be suspend-aware,
but do not want to deal with the complications of CLOCK_REALTIME
(which might jump around if settimeofday is called).

For these applications, I propose a new clockid: CLOCK_BOOTTIME.
CLOCK_BOOTTIME is idential to CLOCK_MONOTONIC, except it also
includes any time spent in suspend.

This patch add hrtimer base for CLOCK_BOOTTIME, using
get_monotonic_boottime/ktime_get_boottime, to allow
in kernel users to set timers against.

CC: Jamie Lokier <jamie@shareable.org>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Alexander Shishkin <virtuoso@slind.org>
CC: Arve Hjønnevåg <arve@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
include/linux/hrtimer.h
include/linux/time.h
kernel/hrtimer.c