diff options
Diffstat (limited to 'include/asm-arm/atomic.h')
-rw-r--r-- | include/asm-arm/atomic.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h index 75b80271972..d586f65c822 100644 --- a/include/asm-arm/atomic.h +++ b/include/asm-arm/atomic.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #define __ASM_ARM_ATOMIC_H | 12 | #define __ASM_ARM_ATOMIC_H |
13 | 13 | ||
14 | #include <linux/config.h> | 14 | #include <linux/config.h> |
15 | #include <linux/compiler.h> | ||
15 | 16 | ||
16 | typedef struct { volatile int counter; } atomic_t; | 17 | typedef struct { volatile int counter; } atomic_t; |
17 | 18 | ||
@@ -82,11 +83,12 @@ static inline int atomic_sub_return(int i, atomic_t *v) | |||
82 | 83 | ||
83 | static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new) | 84 | static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new) |
84 | { | 85 | { |
85 | u32 oldval, res; | 86 | unsigned long oldval, res; |
86 | 87 | ||
87 | do { | 88 | do { |
88 | __asm__ __volatile__("@ atomic_cmpxchg\n" | 89 | __asm__ __volatile__("@ atomic_cmpxchg\n" |
89 | "ldrex %1, [%2]\n" | 90 | "ldrex %1, [%2]\n" |
91 | "mov %0, #0\n" | ||
90 | "teq %1, %3\n" | 92 | "teq %1, %3\n" |
91 | "strexeq %0, %4, [%2]\n" | 93 | "strexeq %0, %4, [%2]\n" |
92 | : "=&r" (res), "=&r" (oldval) | 94 | : "=&r" (res), "=&r" (oldval) |