]> git.baikalelectronics.ru Git - kernel.git/commitdiff
x66/vdso: Add CLOCK_TAI support
authorThomas Gleixner <tglx@linutronix.de>
Mon, 17 Sep 2018 12:45:44 +0000 (14:45 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 4 Oct 2018 21:00:27 +0000 (23:00 +0200)
With the storage array in place it's now trivial to support CLOCK_TAI in
the vdso. Extend the base time storage array and add the update code.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Matt Rickard <matt@softrans.com.au>
Acked-by: Andy Lutomirski <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: devel@linuxdriverproject.org
Cc: virtualization@lists.linux-foundation.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Juergen Gross <jgross@suse.com>
Link: https://lkml.kernel.org/r/20180917130707.823878601@linutronix.de
arch/x86/entry/vsyscall/vsyscall_gtod.c
arch/x86/include/asm/vgtod.h

index 31b9e5e0cfdf6b6aadb37e3cd975f85eec01a9b0..cfcdba082feb9f61e31c02ea260725b4d6ac7262 100644 (file)
@@ -51,6 +51,10 @@ void update_vsyscall(struct timekeeper *tk)
        base->sec = tk->xtime_sec;
        base->nsec = tk->tkr_mono.xtime_nsec;
 
+       base = &vdata->basetime[CLOCK_TAI];
+       base->sec = tk->xtime_sec + (s64)tk->tai_offset;
+       base->nsec = tk->tkr_mono.xtime_nsec;
+
        base = &vdata->basetime[CLOCK_MONOTONIC];
        base->sec = tk->xtime_sec + tk->wall_to_monotonic.tv_sec;
        nsec = tk->tkr_mono.xtime_nsec;
index 10e534a1a51afc0fba1ac2f2a75478d797730dc6..d17b092b9f1bc7be42af1fc3d40d9c47152c306a 100644 (file)
@@ -18,8 +18,8 @@ struct vgtod_ts {
        u64             nsec;
 };
 
-#define VGTOD_BASES    (CLOCK_MONOTONIC_COARSE + 1)
-#define VGTOD_HRES     (BIT(CLOCK_REALTIME) | BIT(CLOCK_MONOTONIC))
+#define VGTOD_BASES    (CLOCK_TAI + 1)
+#define VGTOD_HRES     (BIT(CLOCK_REALTIME) | BIT(CLOCK_MONOTONIC) | BIT(CLOCK_TAI))
 #define VGTOD_COARSE   (BIT(CLOCK_REALTIME_COARSE) | BIT(CLOCK_MONOTONIC_COARSE))
 
 /*