| OLD | NEW |
| (Empty) |
| 1 #define a_ll a_ll | |
| 2 static inline int a_ll(volatile int* p) { | |
| 3 int v; | |
| 4 __asm__ __volatile__( | |
| 5 ".set push ; .set mips2\n\t" | |
| 6 "ll %0, %1" | |
| 7 "\n\t.set pop" | |
| 8 : "=r"(v) | |
| 9 : "m"(*p)); | |
| 10 return v; | |
| 11 } | |
| 12 | |
| 13 #define a_sc a_sc | |
| 14 static inline int a_sc(volatile int* p, int v) { | |
| 15 int r; | |
| 16 __asm__ __volatile__( | |
| 17 ".set push ; .set mips2\n\t" | |
| 18 "sc %0, %1" | |
| 19 "\n\t.set pop" | |
| 20 : "=r"(r), "=m"(*p) | |
| 21 : "0"(v) | |
| 22 : "memory"); | |
| 23 return r; | |
| 24 } | |
| 25 | |
| 26 #define a_barrier a_barrier | |
| 27 static inline void a_barrier() { | |
| 28 /* mips2 sync, but using too many directives causes | |
| 29 * gcc not to inline it, so encode with .long instead. */ | |
| 30 __asm__ __volatile__(".long 0xf" : : : "memory"); | |
| 31 } | |
| 32 | |
| 33 #define a_pre_llsc a_barrier | |
| 34 #define a_post_llsc a_barrier | |
| OLD | NEW |