summaryrefslogtreecommitdiff
path: root/linux/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'linux/src/include')
-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