@@ -107,6 +107,7 @@ int main(void)
DEFINE(CLOCK_MONOTONIC_COARSE,CLOCK_MONOTONIC_COARSE);
DEFINE(CLOCK_COARSE_RES, LOW_RES_NSEC);
DEFINE(NSEC_PER_SEC, NSEC_PER_SEC);
+ DEFINE(CLOCKSOURCE_MASK, CLOCKSOURCE_MASK(ARCH_TIMER_NBITS));
BLANK();
DEFINE(VDSO_CS_CYCLE_LAST, offsetof(struct vdso_data, cs_cycle_last));
DEFINE(VDSO_RAW_TIME_SEC, offsetof(struct vdso_data, raw_time_sec));
@@ -69,8 +69,7 @@ x_tmp .req x8
mrs x_tmp, cntvct_el0
/* Calculate cycle delta and convert to ns. */
sub \res, x_tmp, \cycle_last
- /* We can only guarantee 56 bits of precision. */
- movn x_tmp, #0xff00, lsl #48
+ mov x_tmp, #CLOCKSOURCE_MASK
and \res, x_tmp, \res
mul \res, \res, \mult
.endm
get_clock_shifted_nsec macro in vdso/gettimeofday.S has another place where the size of clocksource precision is hardcoded. Use ARCH_TIMER_NBITS to generate mask value. Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com> --- arch/arm64/kernel/asm-offsets.c | 1 + arch/arm64/kernel/vdso/gettimeofday.S | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-)