[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r14801 - in /fsf/trunk/ports: ChangeLog.arm ChangeLog.mips sysdeps/mips/bits/atomic.h sysdeps/unix/sysv/linux/arm/clone.S



Author: eglibc
Date: Wed Aug  3 00:02:46 2011
New Revision: 14801

Log:
Import glibc-ports-mainline for 2011-08-03

Modified:
    fsf/trunk/ports/ChangeLog.arm
    fsf/trunk/ports/ChangeLog.mips
    fsf/trunk/ports/sysdeps/mips/bits/atomic.h
    fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/clone.S

Modified: fsf/trunk/ports/ChangeLog.arm
==============================================================================
--- fsf/trunk/ports/ChangeLog.arm (original)
+++ fsf/trunk/ports/ChangeLog.arm Wed Aug  3 00:02:46 2011
@@ -1,3 +1,7 @@
+2011-08-02  Andrew Haley  <aph@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/clone.S: Mark as .cantunwind.
+
 2011-06-30  Richard Sandiford  <richard.sandiford@xxxxxxxxxx>
 
 	* sysdeps/arm/elf/start.S (_start): Align the constant pool to 4 bytes.

Modified: fsf/trunk/ports/ChangeLog.mips
==============================================================================
--- fsf/trunk/ports/ChangeLog.mips (original)
+++ fsf/trunk/ports/ChangeLog.mips Wed Aug  3 00:02:46 2011
@@ -1,3 +1,7 @@
+2011-08-02  Matt Turner  <mattst88@xxxxxxxxx>
+
+	* sysdeps/mips/bits/atomic.h: Workaround R10K ll/sc errata.
+
 2011-07-25  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/mips/bits/socket.h (PF_NFC, AF_NFC):

Modified: fsf/trunk/ports/sysdeps/mips/bits/atomic.h
==============================================================================
--- fsf/trunk/ports/sysdeps/mips/bits/atomic.h (original)
+++ fsf/trunk/ports/sysdeps/mips/bits/atomic.h Wed Aug  3 00:02:46 2011
@@ -47,6 +47,32 @@
 /* See the comments in <sys/asm.h> about the use of the sync instruction.  */
 #ifndef MIPS_SYNC
 # define MIPS_SYNC	sync
+#endif
+
+/* Certain revisions of the R10000 Processor need an LL/SC Workaround
+   enabled.  Revisions before 3.0 misbehave on atomic operations, and
+   Revs 2.6 and lower deadlock after several seconds due to other errata.
+
+   To quote the R10K Errata:
+      Workaround: The basic idea is to inhibit the four instructions
+      from simultaneously becoming active in R10000. Padding all
+      ll/sc sequences with nops or changing the looping branch in the
+      routines to a branch likely (which is always predicted taken
+      by R10000) will work. The nops should go after the loop, and the
+      number of them should be 28. This number could be decremented for
+      each additional instruction in the ll/sc loop such as the lock
+      modifier(s) between the ll and sc, the looping branch and its
+      delay slot. For typical short routines with one ll/sc loop, any
+      instructions after the loop could also count as a decrement. The
+      nop workaround pollutes the cache more but would be a few cycles
+      faster if all the code is in the cache and the looping branch
+      is predicted not taken.  */
+
+
+#ifdef _MIPS_ARCH_R10000
+#define R10K_BEQZ_INSN "beqzl"
+#else
+#define R10K_BEQZ_INSN "beqz"
 #endif
 
 #define MIPS_SYNC_STR_2(X) #X
@@ -74,7 +100,7 @@
      "bne	%0,%3,2f\n\t"						      \
      "move	%1,%4\n\t"						      \
      "sc	%1,%2\n\t"						      \
-     "beqz	%1,1b\n"						      \
+     R10K_BEQZ_INSN"	%1,1b\n"					      \
      acq	"\n\t"							      \
      ".set	pop\n"							      \
      "2:\n\t"								      \
@@ -98,7 +124,7 @@
      "bne	%0,%3,2f\n\t"						      \
      "move	%1,%4\n\t"						      \
      "scd	%1,%2\n\t"						      \
-     "beqz	%1,1b\n"						      \
+     R10K_BEQZ_INSN"	%1,1b\n"					      \
      acq	"\n\t"							      \
      ".set	pop\n"							      \
      "2:\n\t"								      \
@@ -192,7 +218,7 @@
      "ll	%0,%4\n\t"						      \
      "move	%1,%3\n\t"						      \
      "sc	%1,%2\n\t"						      \
-     "beqz	%1,1b\n"						      \
+     R10K_BEQZ_INSN"	%1,1b\n"					      \
      acq	"\n\t"							      \
      ".set	pop\n"							      \
      "2:\n\t"								      \
@@ -216,7 +242,7 @@
      "lld	%0,%4\n\t"						      \
      "move	%1,%3\n\t"						      \
      "scd	%1,%2\n\t"						      \
-     "beqz	%1,1b\n"						      \
+     R10K_BEQZ_INSN"	%1,1b\n"					      \
      acq	"\n\t"							      \
      ".set	pop\n"							      \
      "2:\n\t"								      \
@@ -251,7 +277,7 @@
      "ll	%0,%4\n\t"						      \
      "addu	%1,%0,%3\n\t"						      \
      "sc	%1,%2\n\t"						      \
-     "beqz	%1,1b\n"						      \
+     R10K_BEQZ_INSN"	%1,1b\n"					      \
      acq	"\n\t"							      \
      ".set	pop\n"							      \
      "2:\n\t"								      \
@@ -275,7 +301,7 @@
      "lld	%0,%4\n\t"						      \
      "daddu	%1,%0,%3\n\t"						      \
      "scd	%1,%2\n\t"						      \
-     "beqz	%1,1b\n"						      \
+     R10K_BEQZ_INSN"	%1,1b\n"					      \
      acq	"\n\t"							      \
      ".set	pop\n"							      \
      "2:\n\t"								      \

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/clone.S
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/clone.S (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/clone.S Wed Aug  3 00:02:46 2011
@@ -81,8 +81,11 @@
 	RETINSTR(, lr)
 
 	cfi_startproc
-	cfi_undefined (lr)
+PSEUDO_END (__clone)
+
 1:
+	.fnstart
+	.cantunwind
 #ifdef RESET_PID
 	tst	ip, #CLONE_THREAD
 	bne	3f
@@ -116,6 +119,6 @@
 	@ and we are done, passing the return value through r0
 	b	PLTJMP(HIDDEN_JUMPTARGET(_exit))
 
-PSEUDO_END (__clone)
+	.fnend
 
 weak_alias (__clone, clone)