From 562d227bf52f28808f0cbfccdcc3545b2f304b49 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Tue, 11 Sep 2012 19:58:13 -0400 Subject: [PATCH] --- yaml --- r: 333875 b: refs/heads/master c: 576094b7f0aaf41aadab9b7d4e5bd85faa432711 h: refs/heads/master i: 333873: bf5aeb0219d76d853c6dfe18c9cb4c4d861f1928 333871: e5ad334b609eeeaa6bd823419bbd7d6d13cd0349 v: v3 --- [refs] | 2 +- trunk/include/linux/timekeeper_internal.h | 36 ++++++++++++++++++----- trunk/kernel/time/Kconfig | 4 +++ trunk/kernel/time/timekeeping.c | 14 +-------- 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/[refs] b/[refs] index 2089a25ef5ed..0dbdfc0d2590 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 706394211648117762edfaeffd6fc04bf3b1a75d +refs/heads/master: 576094b7f0aaf41aadab9b7d4e5bd85faa432711 diff --git a/trunk/include/linux/timekeeper_internal.h b/trunk/include/linux/timekeeper_internal.h index a904d76a5faa..e1d558e237ec 100644 --- a/trunk/include/linux/timekeeper_internal.h +++ b/trunk/include/linux/timekeeper_internal.h @@ -66,16 +66,38 @@ struct timekeeper { seqlock_t lock; }; +static inline struct timespec tk_xtime(struct timekeeper *tk) +{ + struct timespec ts; + + ts.tv_sec = tk->xtime_sec; + ts.tv_nsec = (long)(tk->xtime_nsec >> tk->shift); + return ts; +} + + +#ifdef CONFIG_GENERIC_TIME_VSYSCALL + +extern void update_vsyscall(struct timekeeper *tk); +extern void update_vsyscall_tz(void); -#ifdef CONFIG_GENERIC_TIME_VSYSCALL_OLD -extern void -update_vsyscall_old(struct timespec *ts, struct timespec *wtm, - struct clocksource *c, u32 mult); +#elif defined(CONFIG_GENERIC_TIME_VSYSCALL_OLD) + +extern void update_vsyscall_old(struct timespec *ts, struct timespec *wtm, + struct clocksource *c, u32 mult); extern void update_vsyscall_tz(void); + +static inline void update_vsyscall(struct timekeeper *tk) +{ + struct timespec xt; + + xt = tk_xtime(tk); + update_vsyscall_old(&xt, &tk->wall_to_monotonic, tk->clock, tk->mult); +} + #else -static inline void -update_vsyscall_old(struct timespec *ts, struct timespec *wtm, - struct clocksource *c, u32 mult) + +static inline void update_vsyscall(struct timekeeper *tk) { } static inline void update_vsyscall_tz(void) diff --git a/trunk/kernel/time/Kconfig b/trunk/kernel/time/Kconfig index 489c86154d1f..8601f0db1261 100644 --- a/trunk/kernel/time/Kconfig +++ b/trunk/kernel/time/Kconfig @@ -12,6 +12,10 @@ config CLOCKSOURCE_WATCHDOG config ARCH_CLOCKSOURCE_DATA bool +# Timekeeping vsyscall support +config GENERIC_TIME_VSYSCALL + bool + # Timekeeping vsyscall support config GENERIC_TIME_VSYSCALL_OLD bool diff --git a/trunk/kernel/time/timekeeping.c b/trunk/kernel/time/timekeeping.c index 7c2851384c46..ce618010c373 100644 --- a/trunk/kernel/time/timekeeping.c +++ b/trunk/kernel/time/timekeeping.c @@ -42,15 +42,6 @@ static inline void tk_normalize_xtime(struct timekeeper *tk) } } -static struct timespec tk_xtime(struct timekeeper *tk) -{ - struct timespec ts; - - ts.tv_sec = tk->xtime_sec; - ts.tv_nsec = (long)(tk->xtime_nsec >> tk->shift); - return ts; -} - static void tk_set_xtime(struct timekeeper *tk, const struct timespec *ts) { tk->xtime_sec = ts->tv_sec; @@ -192,14 +183,11 @@ static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk) /* must hold write on timekeeper.lock */ static void timekeeping_update(struct timekeeper *tk, bool clearntp) { - struct timespec xt; - if (clearntp) { tk->ntp_error = 0; ntp_clear(); } - xt = tk_xtime(tk); - update_vsyscall_old(&xt, &tk->wall_to_monotonic, tk->clock, tk->mult); + update_vsyscall(tk); } /**