diff options
author | Linus Torvalds <torvalds@macmini.osdl.org> | 2006-07-09 02:24:18 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@macmini.osdl.org> | 2006-07-09 02:24:18 +0400 |
commit | b862f3b099f3ea672c7438c0b282ce8201d39dfc (patch) | |
tree | 62f8cc2dc2b1c9abb6364b16f3b218a04d121f3e /include/asm-i386/futex.h | |
parent | e2a3d40258fe20d205f8ed592e1e2c0d5529c2e1 (diff) | |
download | linux-b862f3b099f3ea672c7438c0b282ce8201d39dfc.tar.xz |
i386: improve and correct inline asm memory constraints
Use "+m" rather than a combination of "=m" and "m" for improved clarity
and consistency.
This also fixes some inlines that incorrectly didn't tell the compiler
that they read the old value at all, potentially causing the compiler to
generate bogus code. It appear that all of those potential bugs were
hidden by the use of extra "volatile" specifiers on the data structures
in question, though.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-i386/futex.h')
-rw-r--r-- | include/asm-i386/futex.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/asm-i386/futex.h b/include/asm-i386/futex.h index 7b8ceefd010f..946d97cfea23 100644 --- a/include/asm-i386/futex.h +++ b/include/asm-i386/futex.h @@ -20,8 +20,8 @@ .align 8\n\ .long 1b,3b\n\ .previous" \ - : "=r" (oldval), "=r" (ret), "=m" (*uaddr) \ - : "i" (-EFAULT), "m" (*uaddr), "0" (oparg), "1" (0)) + : "=r" (oldval), "=r" (ret), "+m" (*uaddr) \ + : "i" (-EFAULT), "0" (oparg), "1" (0)) #define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \ __asm__ __volatile ( \ @@ -38,9 +38,9 @@ .align 8\n\ .long 1b,4b,2b,4b\n\ .previous" \ - : "=&a" (oldval), "=&r" (ret), "=m" (*uaddr), \ + : "=&a" (oldval), "=&r" (ret), "+m" (*uaddr), \ "=&r" (tem) \ - : "r" (oparg), "i" (-EFAULT), "m" (*uaddr), "1" (0)) + : "r" (oparg), "i" (-EFAULT), "1" (0)) static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr) @@ -123,7 +123,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) " .long 1b,3b \n" " .previous \n" - : "=a" (oldval), "=m" (*uaddr) + : "=a" (oldval), "+m" (*uaddr) : "i" (-EFAULT), "r" (newval), "0" (oldval) : "memory" ); |