mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Fix Read-After-Write (RAW) dependency violation for ar.ccv in
isc_atomic_xadd() and isc_atomic_cmpxchg(). Approved by: dougb@ MFC after: 1 week
This commit is contained in:
parent
4dbb79b42d
commit
de7459e59d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=200202
|
@ -41,7 +41,7 @@ isc_atomic_xadd(isc_int32_t *p, isc_int32_t val)
|
|||
for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) {
|
||||
swapped = prev + val;
|
||||
__asm__ volatile(
|
||||
"mov ar.ccv=%2;"
|
||||
"mov ar.ccv=%2;;"
|
||||
"cmpxchg4.acq %0=%4,%3,ar.ccv"
|
||||
: "=r" (swapped), "=m" (*p)
|
||||
: "r" (prev), "r" (swapped), "m" (*p)
|
||||
|
@ -84,7 +84,7 @@ isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val)
|
|||
isc_int32_t ret;
|
||||
|
||||
__asm__ volatile(
|
||||
"mov ar.ccv=%2;"
|
||||
"mov ar.ccv=%2;;"
|
||||
"cmpxchg4.acq %0=%4,%3,ar.ccv"
|
||||
: "=r" (ret), "=m" (*p)
|
||||
: "r" (cmpval), "r" (val), "m" (*p)
|
||||
|
|
Loading…
Reference in a new issue