arm64: gettimeofday change for timer rollover condition
Adding a check in gettimeofday api for timer rollover condition. Change-Id: I50c36e5983f05700e49987f6e24c1b17f38a9e1f Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
This commit is contained in:
parent
2aa89ab3ff
commit
5dbeb97af8
1 changed files with 13 additions and 4 deletions
|
@ -216,16 +216,25 @@ ENDPROC(__kernel_clock_getres)
|
|||
ENTRY(__do_get_tspec)
|
||||
.cfi_startproc
|
||||
|
||||
/* Read the virtual counter. */
|
||||
isb
|
||||
#if IS_ENABLED(CONFIG_MSM_TIMER_LEAP)
|
||||
#define LEAST_32BITS 0x00000000FFFFFFFF
|
||||
reread:
|
||||
mrs x15, cntvct_el0
|
||||
and x13, x15, #LEAST_32BITS
|
||||
eor x13, x13, #LEAST_32BITS
|
||||
cbz x13, reread
|
||||
#else
|
||||
mrs x15, cntvct_el0
|
||||
#endif
|
||||
|
||||
/* Read from the vDSO data page. */
|
||||
ldr x10, [vdso_data, #VDSO_CS_CYCLE_LAST]
|
||||
ldp x13, x14, [vdso_data, #VDSO_XTIME_CLK_SEC]
|
||||
ldp w11, w12, [vdso_data, #VDSO_CS_MULT]
|
||||
seqcnt_read w9
|
||||
|
||||
/* Read the virtual counter. */
|
||||
isb
|
||||
mrs x15, cntvct_el0
|
||||
|
||||
/* Calculate cycle delta and convert to ns. */
|
||||
sub x10, x15, x10
|
||||
/* We can only guarantee 56 bits of precision. */
|
||||
|
|
Loading…
Add table
Reference in a new issue