aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/include/atomic.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2005-09-15 19:31:22 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2005-09-15 19:31:22 +0000
commit80d52f16dad4676d62d76dccea9ee3e020b608eb (patch)
tree3f673839211ac6f986ce60c40b7aab1d6a8b3cea /sys/powerpc/include/atomic.h
parentd11c07ba568c9f0581176192ce7e9f87441bbdd2 (diff)
downloadsrc-80d52f16dad4676d62d76dccea9ee3e020b608eb.tar.gz
src-80d52f16dad4676d62d76dccea9ee3e020b608eb.zip
Stop using the '+' constraint modifier with inline assembly. The '+'
constraint is actually only allowed for register operands. Instead, use separate input and output memory constraints. Education from: alc Reviewed by: alc Tested on: i386, alpha MFC after: 1 week
Notes
Notes: svn path=/head/; revision=150182
Diffstat (limited to 'sys/powerpc/include/atomic.h')
-rw-r--r--sys/powerpc/include/atomic.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/powerpc/include/atomic.h b/sys/powerpc/include/atomic.h
index af7bb95335fb..0bc8f2176b2b 100644
--- a/sys/powerpc/include/atomic.h
+++ b/sys/powerpc/include/atomic.h
@@ -63,8 +63,8 @@ atomic_set_32(volatile uint32_t *p, uint32_t v)
"or %0, %3, %0\n\t" /* calculate new value */
"stwcx. %0, 0, %2\n\t" /* attempt to store */
"bne- 1b\n\t" /* spin if failed */
- : "=&r" (temp), "+m" (*p)
- : "r" (p), "r" (v)
+ : "=&r" (temp), "=m" (*p)
+ : "r" (p), "r" (v), "m" (*p)
: "cc", "memory");
#endif
}
@@ -80,8 +80,8 @@ atomic_clear_32(volatile uint32_t *p, uint32_t v)
"andc %0, %0, %3\n\t" /* calculate new value */
"stwcx. %0, 0, %2\n\t" /* attempt to store */
"bne- 1b\n\t" /* spin if failed */
- : "=&r" (temp), "+m" (*p)
- : "r" (p), "r" (v)
+ : "=&r" (temp), "=m" (*p)
+ : "r" (p), "r" (v), "m" (*p)
: "cc", "memory");
#endif
}
@@ -97,8 +97,8 @@ atomic_add_32(volatile uint32_t *p, uint32_t v)
"add %0, %3, %0\n\t" /* calculate new value */
"stwcx. %0, 0, %2\n\t" /* attempt to store */
"bne- 1b\n\t" /* spin if failed */
- : "=&r" (temp), "+m" (*p)
- : "r" (p), "r" (v)
+ : "=&r" (temp), "=m" (*p)
+ : "r" (p), "r" (v), "m" (*p)
: "cc", "memory");
#endif
}
@@ -114,8 +114,8 @@ atomic_subtract_32(volatile uint32_t *p, uint32_t v)
"subf %0, %3, %0\n\t" /* calculate new value */
"stwcx. %0, 0, %2\n\t" /* attempt to store */
"bne- 1b\n\t" /* spin if failed */
- : "=&r" (temp), "+m" (*p)
- : "r" (p), "r" (v)
+ : "=&r" (temp), "=m" (*p)
+ : "r" (p), "r" (v), "m" (*p)
: "cc", "memory");
#endif
}
@@ -132,8 +132,8 @@ atomic_readandclear_32(volatile uint32_t *addr)
"li %1, 0\n\t" /* load new value */
"stwcx. %1, 0, %3\n\t" /* attempt to store */
"bne- 1b\n\t" /* spin if failed */
- : "=&r"(result), "=&r"(temp), "+m" (*addr)
- : "r" (addr)
+ : "=&r"(result), "=&r"(temp), "=m" (*addr)
+ : "r" (addr), "m" (*addr)
: "cc", "memory");
#endif
@@ -382,8 +382,8 @@ atomic_cmpset_32(volatile uint32_t* p, uint32_t cmpval, uint32_t newval)
"stwcx. %0, 0, %2\n\t" /* clear reservation (74xx) */
"li %0, 0\n\t" /* failure - retval = 0 */
"3:\n\t"
- : "=&r" (ret), "+m" (*p)
- : "r" (p), "r" (cmpval), "r" (newval)
+ : "=&r" (ret), "=m" (*p)
+ : "r" (p), "r" (cmpval), "r" (newval), "m" (*p)
: "cc", "memory");
#endif