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

Next file: linux/arch/m68k/mm/extable.c
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.35/linux/arch/m68k/lib/semaphore.S linux/arch/m68k/lib/semaphore.S
@@ -9,18 +9,26 @@
 #include <linux/linkage.h>
 
 /*
- * "down_failed" is called with the eventual return address
- * in %a0, and the address of the semaphore in %a1. We need
- * to call "__down()", and then re-try until we succeed..
+ * The semaphore operations have a special calling sequence that
+ * allow us to do a simpler in-line version of them. These routines
+ * need to convert that sequence back into the C sequence when
+ * there is contention on the semaphore.
  */
 ENTRY(__down_failed)
 	moveml %a0/%d0/%d1,-(%sp)
-1:	movel %a1,-(%sp)
+	movel %a1,-(%sp)
 	jbsr SYMBOL_NAME(__down)
 	movel (%sp)+,%a1
-	subql #1,(%a1)
-	jmi 1b
 	movel (%sp)+,%d0
+	movel (%sp)+,%d1
+	rts
+
+ENTRY(__down_failed_interruptible)
+	movel %a0,-(%sp)
+	movel %d1,-(%sp)
+	movel %a1,-(%sp)
+	jbsr SYMBOL_NAME(__down_interruptible)
+	movel (%sp)+,%a1
 	movel (%sp)+,%d1
 	rts
 

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