summaryrefslogtreecommitdiff
path: root/include/linux/time.h
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2013-01-15 20:09:47 +0400
committerJohn Stultz <john.stultz@linaro.org>2013-01-16 06:16:07 +0400
commit31ade30692dc9680bfc95700d794818fa3f754ac (patch)
treecb436c839b890d04f589b49f75cb0df59315158e /include/linux/time.h
parentf0dbe81f0e7c39783ad25d9084bbcda131508993 (diff)
downloadlinux-31ade30692dc9680bfc95700d794818fa3f754ac.tar.xz
timekeeping: Add persistent_clock_exist flag
In current kernel, there are several places which need to check whether there is a persistent clock for the platform. Current check is done by calling the read_persistent_clock() and validating its return value. So one optimization is to do the check only once in timekeeping_init(), and use a flag persistent_clock_exist to record it. v2: Add a has_persistent_clock() helper function, as suggested by John. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: John Stultz <john.stultz@linaro.org> Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include/linux/time.h')
-rw-r--r--include/linux/time.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/time.h b/include/linux/time.h
index 0015aea4c4a7..dfbc4e82e8ba 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -115,6 +115,12 @@ static inline bool timespec_valid_strict(const struct timespec *ts)
return true;
}
+extern bool persistent_clock_exist;
+static inline bool has_persistent_clock(void)
+{
+ return persistent_clock_exist;
+}
+
extern void read_persistent_clock(struct timespec *ts);
extern void read_boot_clock(struct timespec *ts);
extern int update_persistent_clock(struct timespec now);