summaryrefslogtreecommitdiffstats
path: root/kernel/posix-timers.c
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2012-05-03 12:43:40 -0700
committerJohn Stultz <john.stultz@linaro.org>2013-03-22 16:19:59 -0700
commit1ff3c9677bff7e468e0c487d0ffefe4e901d33f4 (patch)
tree202cef5857654e15eb471c2216f37f995f1c6e2f /kernel/posix-timers.c
parentcc244ddae6d4c6902ac9d7d64023534f8c44a7eb (diff)
downloadop-kernel-dev-1ff3c9677bff7e468e0c487d0ffefe4e901d33f4.zip
op-kernel-dev-1ff3c9677bff7e468e0c487d0ffefe4e901d33f4.tar.gz
timekeeping: Add CLOCK_TAI clockid
This add a CLOCK_TAI clockid and the needed accessors. CC: Thomas Gleixner <tglx@linutronix.de> CC: Eric Dumazet <eric.dumazet@gmail.com> CC: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/posix-timers.c')
-rw-r--r--kernel/posix-timers.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 6edbb2c..fbfc5f1 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -221,6 +221,11 @@ static int posix_get_boottime(const clockid_t which_clock, struct timespec *tp)
return 0;
}
+static int posix_get_tai(clockid_t which_clock, struct timespec *tp)
+{
+ timekeeping_clocktai(tp);
+ return 0;
+}
/*
* Initialize everything, well, just everything in Posix clocks/timers ;)
@@ -261,6 +266,10 @@ static __init int init_posix_timers(void)
.clock_getres = posix_get_coarse_res,
.clock_get = posix_get_monotonic_coarse,
};
+ struct k_clock clock_tai = {
+ .clock_getres = hrtimer_get_res,
+ .clock_get = posix_get_tai,
+ };
struct k_clock clock_boottime = {
.clock_getres = hrtimer_get_res,
.clock_get = posix_get_boottime,
@@ -278,6 +287,7 @@ static __init int init_posix_timers(void)
posix_timers_register_clock(CLOCK_REALTIME_COARSE, &clock_realtime_coarse);
posix_timers_register_clock(CLOCK_MONOTONIC_COARSE, &clock_monotonic_coarse);
posix_timers_register_clock(CLOCK_BOOTTIME, &clock_boottime);
+ posix_timers_register_clock(CLOCK_TAI, &clock_tai);
posix_timers_cache = kmem_cache_create("posix_timers_cache",
sizeof (struct k_itimer), 0, SLAB_PANIC,
OpenPOWER on IntegriCloud