patch-2.1.12 linux/arch/m68k/lib/semaphore.S

Next file: linux/arch/m68k/mm/Makefile
Previous file: linux/arch/m68k/lib/checksum.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.11/linux/arch/m68k/lib/semaphore.S linux/arch/m68k/lib/semaphore.S
@@ -11,19 +11,24 @@
 /*
  * "down_failed" is called with the eventual return address
  * in %a0, and the address of the semaphore in %a1. We need
- * to increment the number of waiters on the semaphore,
- * call "__down()", and then eventually return to try again.
+ * to call "__down()", and then re-try until we succeed..
  */
-ENTRY(down_failed)
-	movel %a0,-(%sp)
-	movel %a1,-(%sp)
+ENTRY(__down_failed)
+	moveml %a0/%d0/%d1,-(%sp)
+1:	movel %a1,-(%sp)
 	jbsr SYMBOL_NAME(__down)
 	movel (%sp)+,%a1
+	subql #1,(%a1)
+	jmi 1b
+	movel (%sp)+,%d0
+	movel (%sp)+,%d1
 	rts
 
-ENTRY(up_wakeup)
-	movel %a0,-(%sp)
+ENTRY(__up_wakeup)
+	moveml %a0/%d0/%d1,-(%sp)
 	movel %a1,-(%sp)
 	jbsr SYMBOL_NAME(__up)
 	movel (%sp)+,%a1
+	movel (%sp)+,%d0
+	movel (%sp)+,%d1
 	rts

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