summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2015-05-01 19:35:50 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-05-01 19:35:50 +0200
commit75a78c0eb4ed2d4bb9b461c4dae8aa71804b238b (patch)
tree736bdc58a3eccf3b958d87dbd320e39cc451e45a
parentea6acb75acf2cb3438f8b93480a2a4729807db85 (diff)
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.
-rw-r--r--linux/src/include/asm-i386/bitops.h6
-rw-r--r--linux/src/include/asm-i386/semaphore.h26
2 files changed, 17 insertions, 15 deletions
diff --git a/linux/src/include/asm-i386/bitops.h b/linux/src/include/asm-i386/bitops.h
index fc4cf19..0bfa9fd 100644
--- a/linux/src/include/asm-i386/bitops.h
+++ b/linux/src/include/asm-i386/bitops.h
@@ -108,6 +108,7 @@ extern __inline__ int test_bit(int nr, const SMPVOL void * addr)
*/
extern __inline__ int find_first_zero_bit(void * addr, unsigned size)
{
+ int d0, d1, d2;
int res;
if (!size)
@@ -123,9 +124,8 @@ extern __inline__ int find_first_zero_bit(void * addr, unsigned size)
"1:\tsubl %%ebx,%%edi\n\t"
"shll $3,%%edi\n\t"
"addl %%edi,%%edx"
- :"=d" (res)
- :"c" ((size + 31) >> 5), "D" (addr), "b" (addr)
- :"ax", "cx", "di");
+ :"=d" (res), "=&c" (d0), "=&D" (d1), "=&a" (d2)
+ :"1" ((size + 31) >> 5), "2" (addr), "b" (addr));
return res;
}
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