Skip to content

Commit

Permalink
[PATCH] Use early clobber in semaphores
Browse files Browse the repository at this point in the history
New code clobbers the result always early, so tell gcc about it
Signed-off-by: Andi Kleen <ak@suse.de>
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Sep 29, 2006
1 parent 34596dc commit c84ef53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/asm-x86_64/semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static inline int down_interruptible(struct semaphore * sem)
"jns 2f\n\t"
"call __down_failed_interruptible\n"
"2:\n"
:"=a" (result), "=m" (sem->count)
:"=&a" (result), "=m" (sem->count)
:"D" (sem)
:"memory");
return result;
Expand All @@ -153,7 +153,7 @@ static inline int down_trylock(struct semaphore * sem)
"jns 2f\n\t"
"call __down_failed_trylock\n\t"
"2:\n"
:"=a" (result), "=m" (sem->count)
:"=&a" (result), "=m" (sem->count)
:"D" (sem)
:"memory","cc");
return result;
Expand Down

0 comments on commit c84ef53

Please sign in to comment.