aboutsummaryrefslogtreecommitdiff
path: root/include/linux/timekeeping.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-07-16 21:04:22 +0000
committerJohn Stultz <john.stultz@linaro.org>2014-07-23 10:18:01 -0700
commit9a6b51976ea3a326b6de534beec3fd87275f4ef6 (patch)
tree4f9eed2b231c527dab091620da6354fff97eae28 /include/linux/timekeeping.h
parent48064f5f67d58f95094305ac575d5372b58e265f (diff)
downloadlinux-linaro-stable-9a6b51976ea3a326b6de534beec3fd87275f4ef6.tar.gz
timekeeping: Provide ktime_mono_to_any()
ktime based conversion function to map a monotonic time stamp to a different CLOCK. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include/linux/timekeeping.h')
-rw-r--r--include/linux/timekeeping.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 3050a7d0a5a9..910a98ef2154 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -109,6 +109,7 @@ enum tk_offsets {
extern ktime_t ktime_get(void);
extern ktime_t ktime_get_with_offset(enum tk_offsets offs);
extern ktime_t ktime_get_monotonic_offset(void);
+extern ktime_t ktime_mono_to_any(ktime_t tmono, enum tk_offsets offs);
/**
* ktime_get_real - get the real (wall-) time in ktime_t format
@@ -137,6 +138,14 @@ static inline ktime_t ktime_get_clocktai(void)
return ktime_get_with_offset(TK_OFFS_TAI);
}
+/**
+ * ktime_mono_to_real - Convert monotonic time to clock realtime
+ */
+static inline ktime_t ktime_mono_to_real(ktime_t mono)
+{
+ return ktime_mono_to_any(mono, TK_OFFS_REAL);
+}
+
/*
* RTC specific
*/