summaryrefslogtreecommitdiff
path: root/arch/ia64/kernel/fsyscall_gtod_data.h
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2017-10-31 10:43:39 -0700
committerTony Luck <tony.luck@intel.com>2017-10-31 10:58:36 -0700
commitd4d1fc61eb38ff8e5af657e2d2f2290859a277f2 (patch)
tree7ea81dfb26bb9efa59638d7985b8cb49efd6d8bd /arch/ia64/kernel/fsyscall_gtod_data.h
parent0b07194bb55ed836c2cc7c22e866b87a14681984 (diff)
ia64: Update fsyscall gettime to use modern vsyscall_update
John Stultz provided the outline for this patch back in May 2014 here: http://patches.linaro.org/patch/30501/ but I let this sit on the shelf for too long and in the intervening years almost every field in "struct timekeeper" was changed. So this is almost completely different from his original. Though the key change in arch/ia64/kernel/fsys.S remains the same. The core logic change with the updated vsyscall method is that we preserve the base nanosecond value in shifted nanoseconds, which allows us to avoid truncating and rounding up to the next nanosecond every tick to avoid inconsistencies. Thus the logic moved from nsec = ((cycle_delta * mult)>>shift) + base_nsec; to nsec = ((cycle_delta * mult) + base_snsec) >> shift; Cc: John Stultz <john.stultz@linaro.org> Cc: linux-ia64@vger.kernel.org Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/fsyscall_gtod_data.h')
-rw-r--r--arch/ia64/kernel/fsyscall_gtod_data.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/ia64/kernel/fsyscall_gtod_data.h b/arch/ia64/kernel/fsyscall_gtod_data.h
index dcc514917731..28363bfc9f57 100644
--- a/arch/ia64/kernel/fsyscall_gtod_data.h
+++ b/arch/ia64/kernel/fsyscall_gtod_data.h
@@ -5,10 +5,16 @@
* fsyscall gettimeofday data
*/
+/* like timespec, but includes "shifted nanoseconds" */
+struct time_sn_spec {
+ u64 sec;
+ u64 snsec;
+};
+
struct fsyscall_gtod_data_t {
seqcount_t seq;
- struct timespec wall_time;
- struct timespec monotonic_time;
+ struct time_sn_spec wall_time;
+ struct time_sn_spec monotonic_time;
u64 clk_mask;
u32 clk_mult;
u32 clk_shift;