diff options
author | benno <benno@FreeBSD.org> | 2001-06-26 13:54:17 +0000 |
---|---|---|
committer | benno <benno@FreeBSD.org> | 2001-06-26 13:54:17 +0000 |
commit | cbd5efc8f5b500bd3ee9ab82817d1d40b684d2a4 (patch) | |
tree | 085415fc6fa4c43d62175f399a38364862b58950 /sys/powerpc | |
parent | 44afea740d5be400686a4daa66589c9d6424f57e (diff) | |
download | FreeBSD-src-cbd5efc8f5b500bd3ee9ab82817d1d40b684d2a4.zip FreeBSD-src-cbd5efc8f5b500bd3ee9ab82817d1d40b684d2a4.tar.gz |
Don't initialise ret in atomic_cmpset_32.
Add more synchronisation.
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/include/atomic.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/powerpc/include/atomic.h b/sys/powerpc/include/atomic.h index 1b7088b..c705e11 100644 --- a/sys/powerpc/include/atomic.h +++ b/sys/powerpc/include/atomic.h @@ -336,8 +336,6 @@ atomic_cmpset_32(volatile u_int32_t* p, u_int32_t cmpval, u_int32_t newval) { u_int32_t ret; - ret = 0; - __asm __volatile ( "1:\tlwarx %0, 0, %3\n\t" /* load old value */ "cmplw 0, %1, %0\n\t" /* compare */ @@ -346,6 +344,7 @@ atomic_cmpset_32(volatile u_int32_t* p, u_int32_t cmpval, u_int32_t newval) "stwcx. %0, 0, %3\n\t" /* attempt to store */ "bne- 1b\n\t" /* spin if failed */ "eieio\n" /* memory barrier */ + "sync\n" "2:\t\n" : "=&r" (ret) : "r" (cmpval), "r" (newval), "r" (p) |