Commit ca5de58b authored by Martin Schwidefsky's avatar Martin Schwidefsky

s390/time,vdso: fix clock_gettime for CLOCK_MONOTONIC

With git commit 79c74ecb
"s390/time,vdso: convert to the new update_vsyscall interface"
the new update_vsyscall function already does the sum of xtime
and wall_to_monotonic. The old update_vsyscall function only
copied the wall_to_monotonic offset. The vdso code needs to be
modified to take this into consideration.
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent b5e64b3d
...@@ -46,18 +46,13 @@ __kernel_clock_gettime: ...@@ -46,18 +46,13 @@ __kernel_clock_gettime:
jnm 3f jnm 3f
a %r0,__VDSO_TK_MULT(%r5) a %r0,__VDSO_TK_MULT(%r5)
3: alr %r0,%r2 3: alr %r0,%r2
al %r0,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */ al %r0,__VDSO_WTOM_NSEC(%r5)
al %r1,__VDSO_XTIME_NSEC+4(%r5)
brc 12,4f
ahi %r0,1
4: al %r0,__VDSO_WTOM_NSEC(%r5) /* + wall_to_monotonic.nsec */
al %r1,__VDSO_WTOM_NSEC+4(%r5) al %r1,__VDSO_WTOM_NSEC+4(%r5)
brc 12,5f brc 12,5f
ahi %r0,1 ahi %r0,1
5: l %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ 5: l %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */
srdl %r0,0(%r2) /* >> tk->shift */ srdl %r0,0(%r2) /* >> tk->shift */
l %r2,__VDSO_XTIME_SEC+4(%r5) l %r2,__VDSO_WTOM_SEC+4(%r5)
al %r2,__VDSO_WTOM_SEC+4(%r5)
cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */ cl %r4,__VDSO_UPD_COUNT+4(%r5) /* check update counter */
jne 1b jne 1b
basr %r5,0 basr %r5,0
......
...@@ -37,13 +37,11 @@ __kernel_clock_gettime: ...@@ -37,13 +37,11 @@ __kernel_clock_gettime:
jnz 0b jnz 0b
stck 48(%r15) /* Store TOD clock */ stck 48(%r15) /* Store TOD clock */
lgf %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */ lgf %r2,__VDSO_TK_SHIFT(%r5) /* Timekeeper shift */
lg %r0,__VDSO_XTIME_SEC(%r5) /* tk->xtime_sec */ lg %r0,__VDSO_WTOM_SEC(%r5)
alg %r0,__VDSO_WTOM_SEC(%r5) /* + wall_to_monotonic.sec */
lg %r1,48(%r15) lg %r1,48(%r15)
sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */ sg %r1,__VDSO_XTIME_STAMP(%r5) /* TOD - cycle_last */
msgf %r1,__VDSO_TK_MULT(%r5) /* * tk->mult */ msgf %r1,__VDSO_TK_MULT(%r5) /* * tk->mult */
alg %r1,__VDSO_XTIME_NSEC(%r5) /* + tk->xtime_nsec */ alg %r1,__VDSO_WTOM_NSEC(%r5)
alg %r1,__VDSO_WTOM_NSEC(%r5) /* + wall_to_monotonic.nsec */
srlg %r1,%r1,0(%r2) /* >> tk->shift */ srlg %r1,%r1,0(%r2) /* >> tk->shift */
clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */
jne 0b jne 0b
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment