arm64: fix mask in atomic_testand{set,clear}_64
These macros generate both the 32- and 64-bit ops, but the mask was hard coded for 32-bit ops, causing the 64-bit ops always to affect only the low 32 bits. PR: 252324 Reported by: gbe, mmel Reviewed by: markj, mmel Tested by: mmel, rwatson Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27886
This commit is contained in:
parent
3630506b9d
commit
82661227ed
@ -409,7 +409,7 @@ _ATOMIC_TEST_OP_PROTO(t, op, _llsc) \
|
||||
uint##t##_t mask, old, tmp; \
|
||||
int res; \
|
||||
\
|
||||
mask = 1u << (val & 0x1f); \
|
||||
mask = ((uint##t##_t)1) << (val & (t - 1)); \
|
||||
__asm __volatile( \
|
||||
"1: ldxr %"#w"2, [%3]\n" \
|
||||
" "#llsc_asm_op" %"#w"0, %"#w"2, %"#w"4\n" \
|
||||
@ -427,7 +427,7 @@ _ATOMIC_TEST_OP_PROTO(t, op, _lse) \
|
||||
{ \
|
||||
uint##t##_t mask, old; \
|
||||
\
|
||||
mask = 1u << (val & 0x1f); \
|
||||
mask = ((uint##t##_t)1) << (val & (t - 1)); \
|
||||
__asm __volatile( \
|
||||
".arch_extension lse\n" \
|
||||
"ld"#lse_asm_op" %"#w"2, %"#w"0, [%1]\n" \
|
||||
|
Loading…
Reference in New Issue
Block a user