diff options
author | Simon Horman <horms+renesas@verge.net.au> | 2015-11-24 06:00:02 +0300 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2015-11-24 06:00:02 +0300 |
commit | 998f468f34f41905051556a9897dbc204b1b75b4 (patch) | |
tree | 75e402d58ccdcf516daf6a0fa8f54e33cf841787 /arch/nios2/include/asm/cmpxchg.h | |
parent | d537543b3948bc3bc9dede248fa455493e055457 (diff) | |
parent | 8005c49d9aea74d382f474ce11afbbc7d7130bec (diff) | |
download | linux-998f468f34f41905051556a9897dbc204b1b75b4.tar.xz |
Merge tag 'v4.4-rc1' into HEAD
Linux 4.4-rc1
Diffstat (limited to 'arch/nios2/include/asm/cmpxchg.h')
-rw-r--r-- | arch/nios2/include/asm/cmpxchg.h | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/arch/nios2/include/asm/cmpxchg.h b/arch/nios2/include/asm/cmpxchg.h index 85938711542d..a7978f14d157 100644 --- a/arch/nios2/include/asm/cmpxchg.h +++ b/arch/nios2/include/asm/cmpxchg.h @@ -9,53 +9,6 @@ #ifndef _ASM_NIOS2_CMPXCHG_H #define _ASM_NIOS2_CMPXCHG_H -#include <linux/irqflags.h> - -#define xchg(ptr, x) \ - ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) - -struct __xchg_dummy { unsigned long a[100]; }; -#define __xg(x) ((volatile struct __xchg_dummy *)(x)) - -static inline unsigned long __xchg(unsigned long x, volatile void *ptr, - int size) -{ - unsigned long tmp, flags; - - local_irq_save(flags); - - switch (size) { - case 1: - __asm__ __volatile__( - "ldb %0, %2\n" - "stb %1, %2\n" - : "=&r" (tmp) - : "r" (x), "m" (*__xg(ptr)) - : "memory"); - break; - case 2: - __asm__ __volatile__( - "ldh %0, %2\n" - "sth %1, %2\n" - : "=&r" (tmp) - : "r" (x), "m" (*__xg(ptr)) - : "memory"); - break; - case 4: - __asm__ __volatile__( - "ldw %0, %2\n" - "stw %1, %2\n" - : "=&r" (tmp) - : "r" (x), "m" (*__xg(ptr)) - : "memory"); - break; - } - - local_irq_restore(flags); - return tmp; -} - #include <asm-generic/cmpxchg.h> -#include <asm-generic/cmpxchg-local.h> #endif /* _ASM_NIOS2_CMPXCHG_H */ |