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:
@@ -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)) \
|
||||
|
||||
Reference in New Issue
Block a user