1 #define LLSC_CLOBBERS "r0", "t", "memory"
2 #define LLSC_START(mem) "synco\n" \
3 "0: movli.l @" mem ", r0\n"
4 #define LLSC_END(mem) \
5 "1: movco.l r0, @" mem "\n" \
9 static inline int __sh_cas_llsc(volatile int *p, int t, int s)
19 : "=&r"(old) : "r"(p), "r"(t), "r"(s) : LLSC_CLOBBERS);
23 static inline int __sh_swap_llsc(volatile int *x, int v)
31 : "=&r"(old) : "r"(x), "r"(v) : LLSC_CLOBBERS);
35 static inline int __sh_fetch_add_llsc(volatile int *x, int v)
43 : "=&r"(old) : "r"(x), "r"(v) : LLSC_CLOBBERS);
47 static inline void __sh_store_llsc(volatile int *p, int x)
53 : : "r"(p), "r"(x) : "memory");
56 static inline void __sh_and_llsc(volatile int *x, int v)
62 : : "r"(x), "r"(v) : LLSC_CLOBBERS);
65 static inline void __sh_or_llsc(volatile int *x, int v)
71 : : "r"(x), "r"(v) : LLSC_CLOBBERS);
75 #define a_cas(p,t,s) __sh_cas_llsc(p,t,s)
76 #define a_swap(x,v) __sh_swap_llsc(x,v)
77 #define a_fetch_add(x,v) __sh_fetch_add_llsc(x, v)
78 #define a_store(x,v) __sh_store_llsc(x, v)
79 #define a_and(x,v) __sh_and_llsc(x, v)
80 #define a_or(x,v) __sh_or_llsc(x, v)
83 int __sh_cas(volatile int *, int, int);
84 int __sh_swap(volatile int *, int);
85 int __sh_fetch_add(volatile int *, int);
86 void __sh_store(volatile int *, int);
87 void __sh_and(volatile int *, int);
88 void __sh_or(volatile int *, int);
90 #define a_cas(p,t,s) __sh_cas(p,t,s)
91 #define a_swap(x,v) __sh_swap(x,v)
92 #define a_fetch_add(x,v) __sh_fetch_add(x, v)
93 #define a_store(x,v) __sh_store(x, v)
94 #define a_and(x,v) __sh_and(x, v)
95 #define a_or(x,v) __sh_or(x, v)