]> Pileus Git - ~andy/linux/blobdiff - include/linux/timekeeper_internal.h
time: Introduce new GENERIC_TIME_VSYSCALL
[~andy/linux] / include / linux / timekeeper_internal.h
index a904d76a5faa528a594ee9866acf97522c556503..e1d558e237ecfdd8059106c4e98f488ff406ff12 100644 (file)
@@ -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)