[uClibc-cvs] svn commit: trunk/uClibc/libc/sysdeps/linux/arm/bits

vapier at uclibc.org vapier at uclibc.org
Mon Aug 15 03:04:39 UTC 2005


Author: vapier
Date: 2005-08-14 21:04:38 -0600 (Sun, 14 Aug 2005)
New Revision: 11151

Log:
import thumb support from jbowler in Bug 385

Modified:
   trunk/uClibc/libc/sysdeps/linux/arm/bits/atomicity.h


Changeset:
Modified: trunk/uClibc/libc/sysdeps/linux/arm/bits/atomicity.h
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/arm/bits/atomicity.h	2005-08-14 19:26:14 UTC (rev 11150)
+++ trunk/uClibc/libc/sysdeps/linux/arm/bits/atomicity.h	2005-08-15 03:04:38 UTC (rev 11151)
@@ -31,12 +31,23 @@
   int tmp2;
   int result;
   __asm__ ("\n"
+#if defined(__thumb__)
+	   "\t.align 0\n"
+	   "\tbx pc\n"
+	   "\tnop\n"
+	   "\t.arm\n"
+#endif
 	   "0:\tldr\t%0,[%3]\n\t"
 	   "add\t%1,%0,%4\n\t"
 	   "swp\t%2,%1,[%3]\n\t"
 	   "cmp\t%0,%2\n\t"
 	   "swpne\t%1,%2,[%3]\n\t"
 	   "bne\t0b"
+#if defined(__thumb__)
+	   "\torr %1, pc, #1\n"
+	   "\tbx %1\n"
+	   "\t.force_thumb"
+#endif
 	   : "=&r" (result), "=&r" (tmp1), "=&r" (tmp2)
 	   : "r" (mem), "r"(val)
 	   : "cc", "memory");
@@ -51,12 +62,23 @@
   int tmp2;
   int tmp3;
   __asm__ ("\n"
+#if defined(__thumb__)
+	   "\t.align 0\n"
+	   "\tbx pc\n"
+	   "\tnop\n"
+	   "\t.arm\n"
+#endif
 	   "0:\tldr\t%0,[%3]\n\t"
 	   "add\t%1,%0,%4\n\t"
 	   "swp\t%2,%1,[%3]\n\t"
 	   "cmp\t%0,%2\n\t"
 	   "swpne\t%1,%2,[%3]\n\t"
 	   "bne\t0b"
+#if defined(__thumb__)
+	   "\torr %1, pc, #1\n"
+	   "\tbx %1\n"
+	   "\t.force_thumb"
+#endif
 	   : "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3)
 	   : "r" (mem), "r"(val)
 	   : "cc", "memory");
@@ -68,6 +90,12 @@
 {
   int result, tmp;
   __asm__ ("\n"
+#if defined(__thumb__)
+	   "\t.align 0\n"
+	   "\tbx pc\n"
+	   "\tnop\n"
+	   "\t.arm\n"
+#endif
 	   "0:\tldr\t%1,[%2]\n\t"
 	   "mov\t%0,#0\n\t"
 	   "cmp\t%1,%4\n\t"
@@ -78,6 +106,11 @@
 	   "bne\t0b\n\t"
 	   "mov\t%0,#1\n"
 	   "1:"
+#if defined(__thumb__)
+	   "\torr %1, pc, #1\n"
+	   "\tbx %1\n"
+	   "\t.force_thumb"
+#endif
 	   : "=&r" (result), "=&r" (tmp)
 	   : "r" (p), "r" (newval), "r" (oldval)
 	   : "cc", "memory");




More information about the uClibc-cvs mailing list