From 75a78c0eb4ed2d4bb9b461c4dae8aa71804b238b Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 1 May 2015 19:35:50 +0200 Subject: Replace clobbers with earlyclobbers Newer gccs consider the former "impossible" * linux/src/include/asm-i386/bitops.h (find_first_zero_bit): Replace clobbers with earlyclobbers. * linux/src/include/asm-i386/semaphore.h (down, down_interruptible, up): Likewise. --- linux/src/include/asm-i386/semaphore.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'linux/src/include/asm-i386/semaphore.h') diff --git a/linux/src/include/asm-i386/semaphore.h b/linux/src/include/asm-i386/semaphore.h index 1486d1c..2a5f5b7 100644 --- a/linux/src/include/asm-i386/semaphore.h +++ b/linux/src/include/asm-i386/semaphore.h @@ -43,18 +43,19 @@ extern void __up(struct semaphore * sem); */ extern inline void down(struct semaphore * sem) { + int d0; __asm__ __volatile__( "# atomic down operation\n\t" "movl $1f,%%eax\n\t" #ifdef __SMP__ "lock ; " #endif - "decl 0(%0)\n\t" + "decl %1\n\t" "js " SYMBOL_NAME_STR(down_failed) "\n" "1:\n" - :/* no outputs */ - :"c" (sem) - :"ax","dx","memory"); + :"=&a" (d0), "=m" (sem->count) + : + :"memory"); } /* @@ -91,13 +92,13 @@ extern inline int down_interruptible(struct semaphore * sem) #ifdef __SMP__ "lock ; " #endif - "decl 0(%1)\n\t" + "decl %1\n\t" "js " SYMBOL_NAME_STR(down_failed_interruptible) "\n\t" "xorl %%eax,%%eax\n" "2:\n" - :"=a" (ret) - :"c" (sem) - :"ax","dx","memory"); + :"=&a" (ret), "=m" (sem->count) + : + :"memory"); return(ret) ; } @@ -110,18 +111,19 @@ extern inline int down_interruptible(struct semaphore * sem) */ extern inline void up(struct semaphore * sem) { + int d0; __asm__ __volatile__( "# atomic up operation\n\t" "movl $1f,%%eax\n\t" #ifdef __SMP__ "lock ; " #endif - "incl 0(%0)\n\t" + "incl %1\n\t" "jle " SYMBOL_NAME_STR(up_wakeup) "\n1:" - :/* no outputs */ - :"c" (sem) - :"ax", "dx", "memory"); + :"=&a" (d0), "=m" (sem->count) + : + :"memory"); } #endif -- cgit v1.2.3