]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/uclibc/uclibc-0.9.27/thumb-swp.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / uclibc / uclibc-0.9.27 / thumb-swp.patch
1 --- uClibc-0.9.27/libc/sysdeps/linux/arm/bits/atomicity.h.orig  2005-08-09 13:12:59.663734027 -0700
2 +++ uClibc-0.9.27/libc/sysdeps/linux/arm/bits/atomicity.h       2005-08-09 17:54:14.581605661 -0700
3 @@ -31,12 +31,23 @@
4    int tmp2;
5    int result;
6    __asm__ ("\n"
7 +#if defined(__thumb__)
8 +           "\t.align 0\n"
9 +          "\tbx pc\n"
10 +          "\tnop\n"
11 +          "\t.arm\n"
12 +#endif
13            "0:\tldr\t%0,[%3]\n\t"
14            "add\t%1,%0,%4\n\t"
15            "swp\t%2,%1,[%3]\n\t"
16            "cmp\t%0,%2\n\t"
17            "swpne\t%1,%2,[%3]\n\t"
18            "bne\t0b"
19 +#if defined(__thumb__)
20 +          "\torr %1, pc, #1\n"
21 +          "\tbx %1\n"
22 +          "\t.force_thumb"
23 +#endif
24            : "=&r" (result), "=&r" (tmp1), "=&r" (tmp2)
25            : "r" (mem), "r"(val)
26            : "cc", "memory");
27 @@ -51,12 +62,23 @@
28    int tmp2;
29    int tmp3;
30    __asm__ ("\n"
31 +#if defined(__thumb__)
32 +           "\t.align 0\n"
33 +          "\tbx pc\n"
34 +          "\tnop\n"
35 +          "\t.arm\n"
36 +#endif
37            "0:\tldr\t%0,[%3]\n\t"
38            "add\t%1,%0,%4\n\t"
39            "swp\t%2,%1,[%3]\n\t"
40            "cmp\t%0,%2\n\t"
41            "swpne\t%1,%2,[%3]\n\t"
42            "bne\t0b"
43 +#if defined(__thumb__)
44 +          "\torr %1, pc, #1\n"
45 +          "\tbx %1\n"
46 +          "\t.force_thumb"
47 +#endif
48            : "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3)
49            : "r" (mem), "r"(val)
50            : "cc", "memory");
51 @@ -68,6 +90,12 @@
52  {
53    int result, tmp;
54    __asm__ ("\n"
55 +#if defined(__thumb__)
56 +           "\t.align 0\n"
57 +          "\tbx pc\n"
58 +          "\tnop\n"
59 +          "\t.arm\n"
60 +#endif
61            "0:\tldr\t%1,[%2]\n\t"
62            "mov\t%0,#0\n\t"
63            "cmp\t%1,%4\n\t"
64 @@ -78,6 +106,11 @@
65            "bne\t0b\n\t"
66            "mov\t%0,#1\n"
67            "1:"
68 +#if defined(__thumb__)
69 +          "\torr %1, pc, #1\n"
70 +          "\tbx %1\n"
71 +          "\t.force_thumb"
72 +#endif
73            : "=&r" (result), "=&r" (tmp)
74            : "r" (p), "r" (newval), "r" (oldval)
75            : "cc", "memory");
76 --- uClibc-0.9.27/libpthread/linuxthreads/sysdeps/arm/pt-machine.h.orig 2005-08-09 14:16:50.204774778 -0700
77 +++ uClibc-0.9.27/libpthread/linuxthreads/sysdeps/arm/pt-machine.h      2005-08-09 17:55:54.027863420 -0700
78 @@ -39,9 +39,24 @@
79  {
80    register unsigned int ret;
81  
82 +#if defined(__thumb__)
83 +  void *pc;
84 +  __asm__ __volatile__(
85 +       ".align 0\n"
86 +       "\tbx pc\n"
87 +       "\tnop\n"
88 +       "\t.arm\n"
89 +       "\tswp %0, %2, [%3]\n"
90 +       "\torr %1, pc, #1\n"
91 +       "\tbx %1\n"
92 +       "\t.force_thumb"
93 +       : "=r"(ret), "=r"(pc)
94 +       : "0"(1), "r"(spinlock));
95 +#else
96    __asm__ __volatile__("swp %0, %1, [%2]"
97                        : "=r"(ret)
98                        : "0"(1), "r"(spinlock));
99 +#endif
100  
101    return ret;
102  }