summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-06-22 21:13:20 +0000
committerjhb <jhb@FreeBSD.org>2001-06-22 21:13:20 +0000
commitf8f883d9d61d9c3f8bf43e411deaf15f41421bbf (patch)
tree5a92262be260f53de57ab85dc6cdee926afd8af7
parentce09fa9fbcc566309eb97707b5aadbb9162dadf8 (diff)
downloadFreeBSD-src-f8f883d9d61d9c3f8bf43e411deaf15f41421bbf.zip
FreeBSD-src-f8f883d9d61d9c3f8bf43e411deaf15f41421bbf.tar.gz
Be conservative and always perform an mb after an atomic_cmpset operation.
-rw-r--r--sys/alpha/include/atomic.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/alpha/include/atomic.h b/sys/alpha/include/atomic.h
index 773ae7e..889b7e2 100644
--- a/sys/alpha/include/atomic.h
+++ b/sys/alpha/include/atomic.h
@@ -361,6 +361,7 @@ atomic_cmpset_32(volatile u_int32_t* p, u_int32_t cmpval, u_int32_t newval)
"mov %3, %0\n\t" /* value to store */
"stl_c %0, %1\n\t" /* attempt to store */
"beq %0, 3f\n\t" /* if it failed, spin */
+ "mb\n\t" /* drain to memory */
"2:\n" /* done */
".section .text3,\"ax\"\n" /* improve branch prediction */
"3:\tbr 1b\n" /* try again */
@@ -389,6 +390,7 @@ atomic_cmpset_64(volatile u_int64_t* p, u_int64_t cmpval, u_int64_t newval)
"mov %3, %0\n\t" /* value to store */
"stq_c %0, %1\n\t" /* attempt to store */
"beq %0, 3f\n\t" /* if it failed, spin */
+ "mb\n\t" /* drain to memory */
"2:\n" /* done */
".section .text3,\"ax\"\n" /* improve branch prediction */
"3:\tbr 1b\n" /* try again */
OpenPOWER on IntegriCloud