mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-01 06:04:51 +00:00
zapnot the signed bits in atomic_cmpset_32. Previously this did not work with
negative values because the original value was sign extended but the compared value was not.
This commit is contained in:
parent
8b637659da
commit
c4b689f10a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96211
|
@ -356,6 +356,7 @@ atomic_cmpset_32(volatile u_int32_t* p, u_int32_t cmpval, u_int32_t newval)
|
|||
|
||||
__asm __volatile (
|
||||
"1:\tldl_l %0, %4\n\t" /* load old value */
|
||||
"zapnot %0,0xf,%0\n\t" /* Chop of signed bits */
|
||||
"cmpeq %0, %2, %0\n\t" /* compare */
|
||||
"beq %0, 2f\n\t" /* exit if not equal */
|
||||
"mov %3, %0\n\t" /* value to store */
|
||||
|
|
Loading…
Reference in a new issue