summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-12-15 11:27:10 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2015-12-20 23:36:04 +0100
commitd50eb5385789f2534652b4762acfaea6f8a2c212 (patch)
tree97c0036e0bffda672edc7e03149e9dfee741fe65
parentcd803394ad22e19b1fe8265eebffd0d02c3f3650 (diff)
backports: add ktime_get_boot_ns()
This small helper inline was added in 3.17, we want to use it now so need to backport it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> [add LINUX_BACKPORT] Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/linux/timekeeping.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/backport/backport-include/linux/timekeeping.h b/backport/backport-include/linux/timekeeping.h
index fe42e717..0a3095e0 100644
--- a/backport/backport-include/linux/timekeeping.h
+++ b/backport/backport-include/linux/timekeeping.h
@@ -15,7 +15,14 @@ static inline u64 ktime_get_ns(void)
{
return ktime_to_ns(ktime_get());
}
-#endif
+
+extern ktime_t ktime_get_boottime(void);
+#define ktime_get_boot_ns LINUX_BACKPORT(ktime_get_boot_ns)
+static inline u64 ktime_get_boot_ns(void)
+{
+ return ktime_to_ns(ktime_get_boottime());
+}
+#endif /* < 3.17 */
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
static inline time64_t ktime_get_seconds(void)