patch-2.1.1 linux/include/asm-i386/semaphore.h

Next file: linux/include/asm-i386/sigcontext.h
Previous file: linux/include/asm-i386/segment.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.0/linux/include/asm-i386/semaphore.h linux/include/asm-i386/semaphore.h
@@ -18,8 +18,8 @@
 #define MUTEX ((struct semaphore) { 1, 0, NULL })
 #define MUTEX_LOCKED ((struct semaphore) { 0, 0, NULL })
 
-asmlinkage void down_failed(void /* special register calling convention */);
-asmlinkage void up_wakeup(void /* special register calling convention */);
+asmlinkage void __down_failed(void /* special register calling convention */);
+asmlinkage void __up_wakeup(void /* special register calling convention */);
 
 extern void __down(struct semaphore * sem);
 extern void __up(struct semaphore * sem);
@@ -32,17 +32,17 @@
 extern inline void down(struct semaphore * sem)
 {
 	__asm__ __volatile__(
-		"# atomic down operation\n"
-		"1:\n\t"
-		"movl $1b,%%eax\n\t"
+		"# atomic down operation\n\t"
 #ifdef __SMP__
 		"lock ; "
 #endif
 		"decl %0\n\t"
-		"js " SYMBOL_NAME_STR(down_failed)
+		"movl $1f,%%eax\n\t"
+		"js " SYMBOL_NAME_STR(__down_failed)
+		"\n1:"
 		:/* no outputs */
 		:"m" (sem->count), "c" (sem)
-		:"ax","dx","memory");
+		:"ax", "memory");
 }
 
 /*
@@ -55,16 +55,16 @@
 {
 	__asm__ __volatile__(
 		"# atomic up operation\n\t"
-		"movl $1f,%%eax\n\t"
 #ifdef __SMP__
 		"lock ; "
 #endif
 		"incl %0\n\t"
-		"jle " SYMBOL_NAME_STR(up_wakeup)
+		"movl $1f,%%eax\n\t"
+		"jle " SYMBOL_NAME_STR(__up_wakeup)
 		"\n1:"
 		:/* no outputs */
 		:"m" (sem->count), "c" (sem)
-		:"ax", "dx", "memory");
+		:"ax", "memory");
 }
 
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov