Rename new to newval in inline asm code, to avoid clashes with C++ new.
Also rename cmp to cmpval just to keep the asm variable names similar to the C variable names.
This commit is contained in:
parent
57ec24a023
commit
b62cc0fb26
@ -268,12 +268,12 @@ atomic_cmpset_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval)
|
|||||||
__asm __volatile(
|
__asm __volatile(
|
||||||
"1: \n"
|
"1: \n"
|
||||||
" ldrexd %[tmp], [%[ptr]]\n"
|
" ldrexd %[tmp], [%[ptr]]\n"
|
||||||
" teq %Q[tmp], %Q[cmp]\n"
|
" teq %Q[tmp], %Q[cmpval]\n"
|
||||||
" itee eq \n"
|
" itee eq \n"
|
||||||
" teqeq %R[tmp], %R[cmp]\n"
|
" teqeq %R[tmp], %R[cmpval]\n"
|
||||||
" movne %[ret], #0\n"
|
" movne %[ret], #0\n"
|
||||||
" bne 2f\n"
|
" bne 2f\n"
|
||||||
" strexd %[ret], %[new], [%[ptr]]\n"
|
" strexd %[ret], %[newval], [%[ptr]]\n"
|
||||||
" teq %[ret], #0\n"
|
" teq %[ret], #0\n"
|
||||||
" it ne \n"
|
" it ne \n"
|
||||||
" bne 1b\n"
|
" bne 1b\n"
|
||||||
@ -282,8 +282,8 @@ atomic_cmpset_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval)
|
|||||||
: [ret] "=&r" (ret),
|
: [ret] "=&r" (ret),
|
||||||
[tmp] "=&r" (tmp)
|
[tmp] "=&r" (tmp)
|
||||||
: [ptr] "r" (p),
|
: [ptr] "r" (p),
|
||||||
[cmp] "r" (cmpval),
|
[cmpval] "r" (cmpval),
|
||||||
[new] "r" (newval)
|
[newval] "r" (newval)
|
||||||
: "cc", "memory");
|
: "cc", "memory");
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user