aboutsummaryrefslogtreecommitdiff
path: root/include/asm-arm/atomic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/atomic.h')
-rw-r--r--include/asm-arm/atomic.h4
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 @@
#define __ASM_ARM_ATOMIC_H
#include <linux/config.h>
+#include <linux/compiler.h>
typedef struct { volatile int counter; } atomic_t;
@@ -82,11 +83,12 @@ static inline int atomic_sub_return(int i, atomic_t *v)
static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
{
- u32 oldval, res;
+ unsigned long oldval, res;
do {
__asm__ __volatile__("@ atomic_cmpxchg\n"
"ldrex %1, [%2]\n"
+ "mov %0, #0\n"
"teq %1, %3\n"
"strexeq %0, %4, [%2]\n"
: "=&r" (res), "=&r" (oldval)