| OLD | NEW |
| 1 __attribute__((__visibility__("hidden"))) | 1 __attribute__((__visibility__("hidden"))) |
| 2 extern const void *__arm_atomics[3]; /* gettp, cas, barrier */ | 2 extern const void *__arm_atomics[3]; /* gettp, cas, barrier */ |
| 3 | 3 |
| 4 #if ((__ARM_ARCH_6__ || __ARM_ARCH_6K__ || __ARM_ARCH_6ZK__) && !__thumb__) \ | 4 #if ((__ARM_ARCH_6__ || __ARM_ARCH_6K__ || __ARM_ARCH_6ZK__) && !__thumb__) \ |
| 5 || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7 | 5 || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7 |
| 6 | 6 |
| 7 #define a_ll a_ll | 7 #define a_ll a_ll |
| 8 static inline int a_ll(volatile int *p) | 8 static inline int a_ll(volatile int *p) |
| 9 { | 9 { |
| 10 int v; | 10 int v; |
| 11 __asm__ __volatile__ ("ldrex %0, %1" : "=r"(v) : "Q"(*p)); | 11 __asm__ __volatile__ ("ldrex %0, %1" : "=r"(v) : "Q"(*p)); |
| 12 return v; | 12 return v; |
| 13 } | 13 } |
| 14 | 14 |
| 15 #define a_sc a_sc | 15 #define a_sc a_sc |
| 16 static inline int a_sc(volatile int *p, int v) | 16 static inline int a_sc(volatile int *p, int v) |
| 17 { | 17 { |
| 18 int r; | 18 int r; |
| 19 » __asm__ __volatile__ ("strex %0,%1,%2" : "=&r"(r) : "r"(v), "Q"(*p) : "m
emory"); | 19 » __asm__ __volatile__ ("strex %0,%2,%1" : "=&r"(r), "=Q"(*p) : "r"(v) : "
memory"); |
| 20 return !r; | 20 return !r; |
| 21 } | 21 } |
| 22 | 22 |
| 23 #if __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7 | 23 #if __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7 |
| 24 | 24 |
| 25 #define a_barrier a_barrier | 25 #define a_barrier a_barrier |
| 26 static inline void a_barrier() | 26 static inline void a_barrier() |
| 27 { | 27 { |
| 28 __asm__ __volatile__ ("dmb ish" : : : "memory"); | 28 __asm__ __volatile__ ("dmb ish" : : : "memory"); |
| 29 } | 29 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 59 static inline void a_barrier() | 59 static inline void a_barrier() |
| 60 { | 60 { |
| 61 __asm__ __volatile__("bl __a_barrier" | 61 __asm__ __volatile__("bl __a_barrier" |
| 62 : : : "memory", "cc", "ip", "lr" ); | 62 : : : "memory", "cc", "ip", "lr" ); |
| 63 } | 63 } |
| 64 #endif | 64 #endif |
| 65 | 65 |
| 66 #define a_crash a_crash | 66 #define a_crash a_crash |
| 67 static inline void a_crash() | 67 static inline void a_crash() |
| 68 { | 68 { |
| 69 » __asm__ __volatile__(".byte 0xf1, 0xde" | 69 » __asm__ __volatile__( |
| 70 #ifndef __thumb__ | 70 #ifndef __thumb__ |
| 71 » » ", 0xfd, 0xe7" | 71 » » ".word 0xe7f000f0" |
| 72 #else |
| 73 » » ".short 0xdeff" |
| 72 #endif | 74 #endif |
| 73 : : : "memory"); | 75 : : : "memory"); |
| 74 } | 76 } |
| OLD | NEW |