summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-05-08 05:19:56 +0000
committerjeff <jeff@FreeBSD.org>2002-05-08 05:19:56 +0000
commitb7a3cfaaab3fd0bf3a27c08457ba479c92532130 (patch)
tree360977ebdec5a6e0294170f2e0d3332ba994402f /sys
parente35948a6eff30e777afcc61908c0a408ed551345 (diff)
downloadFreeBSD-src-b7a3cfaaab3fd0bf3a27c08457ba479c92532130.zip
FreeBSD-src-b7a3cfaaab3fd0bf3a27c08457ba479c92532130.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/include/atomic.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/alpha/include/atomic.h b/sys/alpha/include/atomic.h
index 889b7e2..93cdbf6 100644
--- a/sys/alpha/include/atomic.h
+++ b/sys/alpha/include/atomic.h
@@ -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 */
OpenPOWER on IntegriCloud