]> err.no Git - linux-2.6/commitdiff
[PATCH] i386: Use early clobbers for semaphores now
authorAndi Kleen <ak@suse.de>
Wed, 27 Sep 2006 19:38:56 +0000 (21:38 +0200)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 27 Sep 2006 21:39:51 +0000 (14:39 -0700)
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>
include/asm-i386/semaphore.h

index e63b6a68f04c1d976a16f91b35d93eaf4933d8b1..4e34a468c3835cc323eea52518f5c916cea79691 100644 (file)
@@ -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;
@@ -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;