xtensa: use "m" constraint instead of "r" in futex.h assembly
Use "m" constraint instead of "r" for the address, as "m" allows compiler to access adjacent locations using base + offset, while "r" requires updating the base register every time. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
parent
cf3b3baa71
commit
5eff6ca2e3
|
@ -43,10 +43,10 @@
|
||||||
#elif XCHAL_HAVE_S32C1I
|
#elif XCHAL_HAVE_S32C1I
|
||||||
#define __futex_atomic_op(insn, ret, old, uaddr, arg) \
|
#define __futex_atomic_op(insn, ret, old, uaddr, arg) \
|
||||||
__asm__ __volatile( \
|
__asm__ __volatile( \
|
||||||
"1: l32i %[oldval], %[addr], 0\n" \
|
"1: l32i %[oldval], %[mem]\n" \
|
||||||
insn "\n" \
|
insn "\n" \
|
||||||
" wsr %[oldval], scompare1\n" \
|
" wsr %[oldval], scompare1\n" \
|
||||||
"2: s32c1i %[newval], %[addr], 0\n" \
|
"2: s32c1i %[newval], %[mem]\n" \
|
||||||
" bne %[newval], %[oldval], 1b\n" \
|
" bne %[newval], %[oldval], 1b\n" \
|
||||||
" movi %[newval], 0\n" \
|
" movi %[newval], 0\n" \
|
||||||
"3:\n" \
|
"3:\n" \
|
||||||
|
@ -60,9 +60,9 @@
|
||||||
" .section __ex_table,\"a\"\n" \
|
" .section __ex_table,\"a\"\n" \
|
||||||
" .long 1b, 5b, 2b, 5b\n" \
|
" .long 1b, 5b, 2b, 5b\n" \
|
||||||
" .previous\n" \
|
" .previous\n" \
|
||||||
: [oldval] "=&r" (old), [newval] "=&r" (ret) \
|
: [oldval] "=&r" (old), [newval] "=&r" (ret), \
|
||||||
: [addr] "r" (uaddr), [oparg] "r" (arg), \
|
[mem] "+m" (*(uaddr)) \
|
||||||
[fault] "I" (-EFAULT) \
|
: [oparg] "r" (arg), [fault] "I" (-EFAULT) \
|
||||||
: "memory")
|
: "memory")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue