Commit 19de9490 authored by Adrian Reber's avatar Adrian Reber Committed by Pavel Emelyanov

zdtm: fix atomic_{sub, add}_return assembler for aarch64

Running the test suite on aarch64 showed two tests failing (static/fd
and transition/maps0007). Debugging showed that the
atomic_{sub,add}_return() functions did not return the value but the
lower 32bit of the address of that value.

Simply dereferencing the input solves the two mentioned test cases.
Signed-off-by: 's avatarDmitry Safonov <dima@arista.com>
Signed-off-by: 's avatarAdrian Reber <areber@redhat.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 7e0bef54
...@@ -33,7 +33,7 @@ static inline int atomic_add_return(int i, atomic_t *v) ...@@ -33,7 +33,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
" add %w0, %w0, %w3\n" " add %w0, %w0, %w3\n"
" stlxr %w1, %w0, %2\n" " stlxr %w1, %w0, %2\n"
" cbnz %w1, 1b" " cbnz %w1, 1b"
: "=&r" (result), "=&r" (tmp), "+Q" (v) : "=&r" (result), "=&r" (tmp), "+Q" (*v)
: "Ir" (i) : "Ir" (i)
: "cc", "memory"); : "cc", "memory");
...@@ -51,7 +51,7 @@ static inline int atomic_sub_return(int i, atomic_t *v) ...@@ -51,7 +51,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
" sub %w0, %w0, %w3\n" " sub %w0, %w0, %w3\n"
" stlxr %w1, %w0, %2\n" " stlxr %w1, %w0, %2\n"
" cbnz %w1, 1b" " cbnz %w1, 1b"
: "=&r" (result), "=&r" (tmp), "+Q" (v) : "=&r" (result), "=&r" (tmp), "+Q" (*v)
: "Ir" (i) : "Ir" (i)
: "cc", "memory"); : "cc", "memory");
......
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