aboutsummaryrefslogtreecommitdiff
path: root/include/asm-i386/semaphore.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@macmini.osdl.org>2006-07-08 15:24:18 -0700
committerLinus Torvalds <torvalds@macmini.osdl.org>2006-07-08 15:24:18 -0700
commitb862f3b099f3ea672c7438c0b282ce8201d39dfc (patch)
tree62f8cc2dc2b1c9abb6364b16f3b218a04d121f3e /include/asm-i386/semaphore.h
parente2a3d40258fe20d205f8ed592e1e2c0d5529c2e1 (diff)
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/semaphore.h')
-rw-r--r--include/asm-i386/semaphore.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/asm-i386/semaphore.h b/include/asm-i386/semaphore.h
index f7a0f310c52..d51e800acf2 100644
--- a/include/asm-i386/semaphore.h
+++ b/include/asm-i386/semaphore.h
@@ -107,7 +107,7 @@ static inline void down(struct semaphore * sem)
"call __down_failed\n\t"
"jmp 1b\n"
LOCK_SECTION_END
- :"=m" (sem->count)
+ :"+m" (sem->count)
:
:"memory","ax");
}
@@ -132,7 +132,7 @@ static inline int down_interruptible(struct semaphore * sem)
"call __down_failed_interruptible\n\t"
"jmp 1b\n"
LOCK_SECTION_END
- :"=a" (result), "=m" (sem->count)
+ :"=a" (result), "+m" (sem->count)
:
:"memory");
return result;
@@ -157,7 +157,7 @@ static inline int down_trylock(struct semaphore * sem)
"call __down_failed_trylock\n\t"
"jmp 1b\n"
LOCK_SECTION_END
- :"=a" (result), "=m" (sem->count)
+ :"=a" (result), "+m" (sem->count)
:
:"memory");
return result;
@@ -182,7 +182,7 @@ static inline void up(struct semaphore * sem)
"jmp 1b\n"
LOCK_SECTION_END
".subsection 0\n"
- :"=m" (sem->count)
+ :"+m" (sem->count)
:
:"memory","ax");
}