diff options
author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> | 2010-06-22 10:30:15 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2010-10-09 21:51:27 +0200 |
commit | c6691126636769bd22bfd7b55829f0373a93c1ce (patch) | |
tree | ac6cad088a65e5e8b9a5c7035d883f7eb812fdc9 /include/asm-generic | |
parent | 8b9d40691e8f5e7e0c8fb839c2bad29c5e0888ce (diff) | |
download | lwn-c6691126636769bd22bfd7b55829f0373a93c1ce.tar.gz lwn-c6691126636769bd22bfd7b55829f0373a93c1ce.zip |
asm-generic: cmpxchg does not handle non-long arguments
The version of cmpxchg defined in asm-generic/system.h does not handle
correctly non-long arguments. Use the version defined in cmpxchg.h
instead.
Signed-off-by: Mathieu Lacage <mathieu.lacage@inria.fr>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/system.h | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h index efa403b5e121..4b0b9cbbfae5 100644 --- a/include/asm-generic/system.h +++ b/include/asm-generic/system.h @@ -21,6 +21,7 @@ #include <linux/irqflags.h> #include <asm/cmpxchg-local.h> +#include <asm/cmpxchg.h> struct task_struct; @@ -136,25 +137,6 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size) #define xchg(ptr, x) \ ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) -static inline unsigned long __cmpxchg(volatile unsigned long *m, - unsigned long old, unsigned long new) -{ - unsigned long retval; - unsigned long flags; - - local_irq_save(flags); - retval = *m; - if (retval == old) - *m = new; - local_irq_restore(flags); - return retval; -} - -#define cmpxchg(ptr, o, n) \ - ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \ - (unsigned long)(o), \ - (unsigned long)(n))) - #endif /* !__ASSEMBLY__ */ #endif /* __KERNEL__ */ |