diff options
author | Linus Torvalds <torvalds@macmini.osdl.org> | 2006-07-08 15:24:18 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@macmini.osdl.org> | 2006-07-08 15:24:18 -0700 |
commit | b862f3b099f3ea672c7438c0b282ce8201d39dfc (patch) | |
tree | 62f8cc2dc2b1c9abb6364b16f3b218a04d121f3e /include/asm-i386/rwlock.h | |
parent | e2a3d40258fe20d205f8ed592e1e2c0d5529c2e1 (diff) | |
download | lwn-b862f3b099f3ea672c7438c0b282ce8201d39dfc.tar.gz lwn-b862f3b099f3ea672c7438c0b282ce8201d39dfc.zip |
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/rwlock.h')
-rw-r--r-- | include/asm-i386/rwlock.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-i386/rwlock.h b/include/asm-i386/rwlock.h index 94f00195d543..96b0bef2ea56 100644 --- a/include/asm-i386/rwlock.h +++ b/include/asm-i386/rwlock.h @@ -37,7 +37,7 @@ "popl %%eax\n\t" \ "1:\n", \ "subl $1,%0\n\t", \ - "=m" (*(volatile int *)rw) : : "memory") + "+m" (*(volatile int *)rw) : : "memory") #define __build_read_lock(rw, helper) do { \ if (__builtin_constant_p(rw)) \ @@ -63,7 +63,7 @@ "popl %%eax\n\t" \ "1:\n", \ "subl $" RW_LOCK_BIAS_STR ",%0\n\t", \ - "=m" (*(volatile int *)rw) : : "memory") + "+m" (*(volatile int *)rw) : : "memory") #define __build_write_lock(rw, helper) do { \ if (__builtin_constant_p(rw)) \ |