2 static inline int a_ll(volatile int *p)
12 static inline int a_sc(volatile int *p, int v)
15 __asm__ __volatile__ (
17 : "=r"(r), "=m"(*p) : "0"(v) : "memory");
22 static inline void *a_ll_p(volatile long *p)
25 __asm__ __volatile__ (
32 static inline int a_sc_p(volatile long *p, void *v)
35 __asm__ __volatile__ (
37 : "=r"(r), "=m"(*p) : "0"(v) : "memory");
41 #define a_barrier a_barrier
42 static inline void a_barrier()
44 /* mips2 sync, but using too many directives causes
45 * gcc not to inline it, so encode with .long instead. */
46 __asm__ __volatile__ (".long 0xf" : : : "memory");
49 #define a_pre_llsc a_barrier
50 #define a_post_llsc a_barrier