diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-07-16 17:05:16 -0400 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2014-07-23 18:01:53 -0400 |
commit | d28ede83791defee9a81e558540699dc46dbbe13 (patch) | |
tree | 40df9738db287097241fe25493df982ee33b046f /arch/x86/kernel/vsyscall_gtod.c | |
parent | 6d3aadf3e180e09dbefab16478c6876b584ce16e (diff) |
timekeeping: Create struct tk_read_base and use it in struct timekeeper
The members of the new struct are the required ones for the new NMI
safe accessor to clcok monotonic. In order to reuse the existing
timekeeping code and to make the update of the fast NMI safe
timekeepers a simple memcpy use the struct for the timekeeper as well
and convert all users.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'arch/x86/kernel/vsyscall_gtod.c')
-rw-r--r-- | arch/x86/kernel/vsyscall_gtod.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/arch/x86/kernel/vsyscall_gtod.c b/arch/x86/kernel/vsyscall_gtod.c index c3cb3c144591..c7d791f32b98 100644 --- a/arch/x86/kernel/vsyscall_gtod.c +++ b/arch/x86/kernel/vsyscall_gtod.c | |||
@@ -31,29 +31,30 @@ void update_vsyscall(struct timekeeper *tk) | |||
31 | gtod_write_begin(vdata); | 31 | gtod_write_begin(vdata); |
32 | 32 | ||
33 | /* copy vsyscall data */ | 33 | /* copy vsyscall data */ |
34 | vdata->vclock_mode = tk->clock->archdata.vclock_mode; | 34 | vdata->vclock_mode = tk->tkr.clock->archdata.vclock_mode; |
35 | vdata->cycle_last = tk->cycle_last; | 35 | vdata->cycle_last = tk->tkr.cycle_last; |
36 | vdata->mask = tk->clock->mask; | 36 | vdata->mask = tk->tkr.mask; |
37 | vdata->mult = tk->mult; | 37 | vdata->mult = tk->tkr.mult; |
38 | vdata->shift = tk->shift; | 38 | vdata->shift = tk->tkr.shift; |
39 | 39 | ||
40 | vdata->wall_time_sec = tk->xtime_sec; | 40 | vdata->wall_time_sec = tk->xtime_sec; |
41 | vdata->wall_time_snsec = tk->xtime_nsec; | 41 | vdata->wall_time_snsec = tk->tkr.xtime_nsec; |
42 | 42 | ||
43 | vdata->monotonic_time_sec = tk->xtime_sec | 43 | vdata->monotonic_time_sec = tk->xtime_sec |
44 | + tk->wall_to_monotonic.tv_sec; | 44 | + tk->wall_to_monotonic.tv_sec; |
45 | vdata->monotonic_time_snsec = tk->xtime_nsec | 45 | vdata->monotonic_time_snsec = tk->tkr.xtime_nsec |
46 | + ((u64)tk->wall_to_monotonic.tv_nsec | 46 | + ((u64)tk->wall_to_monotonic.tv_nsec |
47 | << tk->shift); | 47 | << tk->tkr.shift); |
48 | while (vdata->monotonic_time_snsec >= | 48 | while (vdata->monotonic_time_snsec >= |
49 | (((u64)NSEC_PER_SEC) << tk->shift)) { | 49 | (((u64)NSEC_PER_SEC) << tk->tkr.shift)) { |
50 | vdata->monotonic_time_snsec -= | 50 | vdata->monotonic_time_snsec -= |
51 | ((u64)NSEC_PER_SEC) << tk->shift; | 51 | ((u64)NSEC_PER_SEC) << tk->tkr.shift; |
52 | vdata->monotonic_time_sec++; | 52 | vdata->monotonic_time_sec++; |
53 | } | 53 | } |
54 | 54 | ||
55 | vdata->wall_time_coarse_sec = tk->xtime_sec; | 55 | vdata->wall_time_coarse_sec = tk->xtime_sec; |
56 | vdata->wall_time_coarse_nsec = (long)(tk->xtime_nsec >> tk->shift); | 56 | vdata->wall_time_coarse_nsec = (long)(tk->tkr.xtime_nsec >> |
57 | tk->tkr.shift); | ||
57 | 58 | ||
58 | vdata->monotonic_time_coarse_sec = | 59 | vdata->monotonic_time_coarse_sec = |
59 | vdata->wall_time_coarse_sec + tk->wall_to_monotonic.tv_sec; | 60 | vdata->wall_time_coarse_sec + tk->wall_to_monotonic.tv_sec; |