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>
This commit is contained in:
Linus Torvalds
2006-07-08 15:24:18 -07:00
parent e2a3d40258
commit b862f3b099
8 changed files with 57 additions and 62 deletions

View File

@@ -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)) \