sh: add J2 atomics using the cas.l instruction
Signed-off-by: Rich Felker <dalias@libc.org>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user