diff options
author | Michal Simek <michal.simek@xilinx.com> | 2020-01-21 16:15:29 +0300 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2020-02-25 14:33:31 +0300 |
commit | 519fa60b6007fe19a32c5a50541dd7b38bd11b37 (patch) | |
tree | 7185a5bbbadd15451fd660e52ded19774d1b3b1f /arch/microblaze/include/asm | |
parent | 06951c9115fe20d479d35c3b4a95c2de0e1d587b (diff) | |
download | linux-519fa60b6007fe19a32c5a50541dd7b38bd11b37.tar.xz |
microblaze: Use asm generic cmpxchg.h for !SMP case
The whole implementation is done in asm-generic/cmpxchg.h file and there is
no reason to duplicate it.
Also do not include asm-generic/cmpxchg-local.h because it is already
included from asm-generic/cmpxchg.h
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Stefan Asserhall <stefan.asserhall@xilinx.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/microblaze/include/asm')
-rw-r--r-- | arch/microblaze/include/asm/cmpxchg.h | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/arch/microblaze/include/asm/cmpxchg.h b/arch/microblaze/include/asm/cmpxchg.h index 596300c74509..3523b51aab36 100644 --- a/arch/microblaze/include/asm/cmpxchg.h +++ b/arch/microblaze/include/asm/cmpxchg.h @@ -2,42 +2,8 @@ #ifndef _ASM_MICROBLAZE_CMPXCHG_H #define _ASM_MICROBLAZE_CMPXCHG_H -#include <linux/irqflags.h> - -void __bad_xchg(volatile void *ptr, int size); - -static inline unsigned long __xchg(unsigned long x, volatile void *ptr, - int size) -{ - unsigned long ret; - unsigned long flags; - - switch (size) { - case 1: - local_irq_save(flags); - ret = *(volatile unsigned char *)ptr; - *(volatile unsigned char *)ptr = x; - local_irq_restore(flags); - break; - - case 4: - local_irq_save(flags); - ret = *(volatile unsigned long *)ptr; - *(volatile unsigned long *)ptr = x; - local_irq_restore(flags); - break; - default: - __bad_xchg(ptr, size), ret = 0; - break; - } - - return ret; -} - -#define xchg(ptr, x) \ - ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) - -#include <asm-generic/cmpxchg.h> -#include <asm-generic/cmpxchg-local.h> +#ifndef CONFIG_SMP +# include <asm-generic/cmpxchg.h> +#endif #endif /* _ASM_MICROBLAZE_CMPXCHG_H */ |