summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/linux/clocksource.h10
-rw-r--r--kernel/timer.c1
2 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 830a250ecf9..daa4940cc0f 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -47,6 +47,7 @@ struct clocksource;
* @mult: cycle to nanosecond multiplier
* @shift: cycle to nanosecond divisor (power of two)
* @flags: flags describing special properties
+ * @vread: vsyscall based read
* @cycle_interval: Used internally by timekeeping core, please ignore.
* @xtime_interval: Used internally by timekeeping core, please ignore.
*/
@@ -59,6 +60,7 @@ struct clocksource {
u32 mult;
u32 shift;
unsigned long flags;
+ cycle_t (*vread)(void);
/* timekeeping specific data, ignore */
cycle_t cycle_last, cycle_interval;
@@ -197,4 +199,12 @@ extern int clocksource_register(struct clocksource*);
extern struct clocksource* clocksource_get_next(void);
extern void clocksource_change_rating(struct clocksource *cs, int rating);
+#ifdef CONFIG_GENERIC_TIME_VSYSCALL
+extern void update_vsyscall(struct timespec *ts, struct clocksource *c);
+#else
+static inline void update_vsyscall(struct timespec *ts, struct clocksource *c)
+{
+}
+#endif
+
#endif /* _LINUX_CLOCKSOURCE_H */
diff --git a/kernel/timer.c b/kernel/timer.c
index c3c67f3c019..cb1b86a9c52 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1174,6 +1174,7 @@ static void update_wall_time(void)
/* check to see if there is a new clocksource to use */
change_clocksource();
+ update_vsyscall(&xtime, clock);
}
/*