From: john stultz Provides generic infrastructure for vsyscall-gtod. Signed-off-by: John Stultz Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Andi Kleen Cc: Roman Zippel Signed-off-by: Andrew Morton --- include/linux/clocksource.h | 8 ++++++++ kernel/timer.c | 1 + 2 files changed, 9 insertions(+) Index: linux-2.6.20-rc6-mm/include/linux/clocksource.h =================================================================== --- linux-2.6.20-rc6-mm.orig/include/linux/clocksource.h +++ linux-2.6.20-rc6-mm/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,10 @@ extern int clocksource_register(struct c 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 +#define update_vsyscall(now, c) do { } while(0) +#endif + #endif /* _LINUX_CLOCKSOURCE_H */ Index: linux-2.6.20-rc6-mm/kernel/timer.c =================================================================== --- linux-2.6.20-rc6-mm.orig/kernel/timer.c +++ linux-2.6.20-rc6-mm/kernel/timer.c @@ -1173,6 +1173,7 @@ static void update_wall_time(void) /* check to see if there is a new clocksource to use */ change_clocksource(); + update_vsyscall(&xtime, clock); } /*