diff options
author | Vincenzo Frascino <vincenzo.frascino@arm.com> | 2019-04-01 12:51:51 +0100 |
---|---|---|
committer | Greentime Hu <greentime@andestech.com> | 2019-05-16 15:07:08 +0800 |
commit | af9abd65983cf3602c03ef3d16fe549ba1f3eeed (patch) | |
tree | 165b6a5c5fa21f59a9d89724ae24573d16f106f7 /arch/nds32/include | |
parent | 63e07e202997ca01336ac93bf45dfd2c3a6ec512 (diff) |
nds32: Fix vDSO clock_getres()
clock_getres in the vDSO library has to preserve the same behaviour
of posix_get_hrtimer_res().
In particular, posix_get_hrtimer_res() does:
sec = 0;
ns = hrtimer_resolution;
and hrtimer_resolution depends on the enablement of the high
resolution timers that can happen either at compile or at run time.
Fix the nds32 vdso implementation of clock_getres keeping a copy of
hrtimer_resolution in vdso data and using that directly.
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Vincent Chen <deanbo422@gmail.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Greentime Hu <greentime@andestech.com>
Diffstat (limited to 'arch/nds32/include')
-rw-r--r-- | arch/nds32/include/asm/vdso_datapage.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/nds32/include/asm/vdso_datapage.h b/arch/nds32/include/asm/vdso_datapage.h index cd1dda3da0f9..74c68802021e 100644 --- a/arch/nds32/include/asm/vdso_datapage.h +++ b/arch/nds32/include/asm/vdso_datapage.h @@ -20,6 +20,7 @@ struct vdso_data { u32 xtime_clock_sec; /* CLOCK_REALTIME - seconds */ u32 cs_mult; /* clocksource multiplier */ u32 cs_shift; /* Cycle to nanosecond divisor (power of two) */ + u32 hrtimer_res; /* hrtimer resolution */ u64 cs_cycle_last; /* last cycle value */ u64 cs_mask; /* clocksource mask */ |