tile: Convert VDSO timekeeping to the precise mechanism
The code was only halfarsed converted to the new VSDO update mechanism and still uses the inaccurate base value which lacks the fractional part of xtime_nsec. Fix it up. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
This commit is contained in:

committed by
John Stultz

parent
988b0c541e
commit
dc01c9fae1
@@ -83,10 +83,11 @@ int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
if (count & 1)
|
||||
continue;
|
||||
|
||||
cycles = (get_cycles() - vdso_data->xtime_tod_stamp);
|
||||
ns = (cycles * vdso_data->mult) >> vdso_data->shift;
|
||||
sec = vdso_data->xtime_clock_sec;
|
||||
ns += vdso_data->xtime_clock_nsec;
|
||||
cycles = get_cycles() - vdso_data->xtime_tod_stamp;
|
||||
ns = (cycles * vdso_data->mult) + vdso_data->xtime_clock_nsec;
|
||||
ns >>= vdso_data->shift;
|
||||
|
||||
if (ns >= NSEC_PER_SEC) {
|
||||
ns -= NSEC_PER_SEC;
|
||||
sec += 1;
|
||||
|
Reference in New Issue
Block a user