[PATCH] generic: vsyscall-gtod support for GENERIC_TIME
authorjohn stultz <[email protected]>
Fri, 16 Feb 2007 09:28:17 +0000 (01:28 -0800)
committerLinus Torvalds <[email protected]>
Fri, 16 Feb 2007 16:14:00 +0000 (08:14 -0800)
Provides generic infrastructure for vsyscall-gtod.

[[email protected]: cleanup]
Signed-off-by: John Stultz <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Roman Zippel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/clocksource.h
kernel/timer.c

index 830a250ecf947688e5fb3b5589e20f908088f828..daa4940cc0f1fa37c9afd87b4ed759aac8c0a6bf 100644 (file)
@@ -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 */
index c3c67f3c0190d42d196987b138955ff8a4d2b535..cb1b86a9c52f5749f767625ffe6f6895f4b476aa 100644 (file)
@@ -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);
 }
 
 /*