sh: add J2 atomics using the cas.l instruction

Signed-off-by: Rich Felker <dalias@libc.org>
This commit is contained in:
Rich Felker
2016-07-28 19:21:10 +00:00
parent 834da19705
commit 2b47d54ed4
9 changed files with 481 additions and 216 deletions

View File

@@ -29,6 +29,11 @@
#define wmb() mb()
#define ctrl_barrier() __icbi(PAGE_OFFSET)
#else
#if defined(CONFIG_CPU_J2) && defined(CONFIG_SMP)
#define __smp_mb() do { int tmp = 0; __asm__ __volatile__ ("cas.l %0,%0,@%1" : "+r"(tmp) : "z"(&tmp) : "memory", "t"); } while(0)
#define __smp_rmb() __smp_mb()
#define __smp_wmb() __smp_mb()
#endif
#define ctrl_barrier() __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop")
#endif