diff options
author | Peter Korsgaard <jacmet@sunsite.dk> | 2010-03-12 23:14:59 +0100 |
---|---|---|
committer | Peter Korsgaard <jacmet@sunsite.dk> | 2010-03-12 23:14:59 +0100 |
commit | de859f6b2ac8660113e15aff6bc394a441dda60e (patch) | |
tree | 2087a5bb8b6dd6e9964f676261efd20a63b593ae /toolchain/uClibc/uClibc-0.9.30.3-xtensa-009-testandset.patch | |
parent | 12ebf5714c58cecdb19dbd9266ace5e9380562b0 (diff) |
toolchain: Add uClibc 0.9.30.3, remove older 0.9.30.x
As the 0.9.30.x stable releases only contain bugfixes, there isn't much
sense in using the older 0.9.30.x releases instead of .3, so use a single
0.9.30.x config similar to how we do it for the kernel headers.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'toolchain/uClibc/uClibc-0.9.30.3-xtensa-009-testandset.patch')
-rw-r--r-- | toolchain/uClibc/uClibc-0.9.30.3-xtensa-009-testandset.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/toolchain/uClibc/uClibc-0.9.30.3-xtensa-009-testandset.patch b/toolchain/uClibc/uClibc-0.9.30.3-xtensa-009-testandset.patch new file mode 100644 index 000000000..f0e4eb272 --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.30.3-xtensa-009-testandset.patch @@ -0,0 +1,59 @@ +--- uClibc-0.9.29/libpthread/linuxthreads.old/sysdeps/xtensa/pt-machine.h.orig 2008-09-12 09:51:50.000000000 -0700 ++++ uClibc-0.9.29/libpthread/linuxthreads.old/sysdeps/xtensa/pt-machine.h 2008-10-04 12:14:57.000000000 -0700 +@@ -26,19 +26,51 @@ + #include <asm/unistd.h> + + #ifndef PT_EI +-# define PT_EI __extern_always_inline ++# define PT_EI extern inline __attribute__ ((gnu_inline)) + #endif + +-/* Memory barrier. */ + #define MEMORY_BARRIER() __asm__ ("memw" : : : "memory") ++#define HAS_COMPARE_AND_SWAP ++ ++extern long int testandset (int *spinlock); ++extern int __compare_and_swap (long int *p, long int oldval, long int newval); + + /* Spinlock implementation; required. */ + PT_EI long int + testandset (int *spinlock) + { +- int unused = 0; +- return INTERNAL_SYSCALL (xtensa, , 4, SYS_XTENSA_ATOMIC_SET, +- spinlock, 1, unused); ++ unsigned long tmp; ++ __asm__ volatile ( ++" movi %0, 0 \n" ++" wsr %0, SCOMPARE1 \n" ++" movi %0, 1 \n" ++" s32c1i %0, %1, 0 \n" ++ : "=&a" (tmp) ++ : "a" (spinlock) ++ : "memory" ++ ); ++ return tmp; ++} ++ ++PT_EI int ++__compare_and_swap (long int *p, long int oldval, long int newval) ++{ ++ unsigned long tmp; ++ unsigned long value; ++ __asm__ volatile ( ++"1: l32i %0, %2, 0 \n" ++" bne %0, %4, 2f \n" ++" wsr %0, SCOMPARE1 \n" ++" mov %1, %0 \n" ++" mov %0, %3 \n" ++" s32c1i %0, %2, 0 \n" ++" bne %1, %0, 1b \n" ++"2: \n" ++ : "=&a" (tmp), "=&a" (value) ++ : "a" (p), "a" (newval), "a" (oldval) ++ : "memory" ); ++ ++ return tmp == oldval; + } + + /* Get some notion of the current stack. Need not be exactly the top |