Skip to content

Commit

Permalink
[PATCH] i386: Use early clobbers for semaphores now
Browse files Browse the repository at this point in the history
The new code does clobber the result early, so make sure to tell
gcc to not put it into the same register as a input argument

Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andrew Morton <akpm@osdl.org>
Acked-by: Kyle McMartin <kyle@parisc-linux.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Sep 27, 2006
1 parent cdb8355 commit 00463c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/asm-i386/semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static inline int down_interruptible(struct semaphore * sem)
"lea %1,%%eax\n\t"
"call __down_failed_interruptible\n"
"2:"
:"=a" (result), "+m" (sem->count)
:"=&a" (result), "+m" (sem->count)
:
:"memory");
return result;
Expand All @@ -148,7 +148,7 @@ static inline int down_trylock(struct semaphore * sem)
"lea %1,%%eax\n\t"
"call __down_failed_trylock\n\t"
"2:\n"
:"=a" (result), "+m" (sem->count)
:"=&a" (result), "+m" (sem->count)
:
:"memory");
return result;
Expand Down

0 comments on commit 00463c1

Please sign in to comment.