File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ config ARC
13
13
select ARCH_HAS_SETUP_DMA_OPS
14
14
select ARCH_HAS_SYNC_DMA_FOR_CPU
15
15
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
16
+ select ARCH_NEED_CMPXCHG_1_EMU
16
17
select ARCH_SUPPORTS_ATOMIC_RMW if ARC_HAS_LLSC
17
18
select ARCH_32BIT_OFF_T
18
19
select BUILDTIME_TABLE_SORT
Original file line number Diff line number Diff line change 8
8
9
9
#include <linux/build_bug.h>
10
10
#include <linux/types.h>
11
+ #include <linux/cmpxchg-emu.h>
11
12
12
13
#include <asm/barrier.h>
13
14
#include <asm/smp.h>
46
47
__typeof__(*(ptr)) _prev_; \
47
48
\
48
49
switch(sizeof((_p_))) { \
50
+ case 1: \
51
+ _prev_ = (__typeof__(*(ptr)))cmpxchg_emu_u8((volatile u8 *)_p_, (uintptr_t)_o_, (uintptr_t)_n_); \
52
+ break; \
49
53
case 4: \
50
54
_prev_ = __cmpxchg(_p_, _o_, _n_); \
51
55
break; \
65
69
__typeof__(*(ptr)) _prev_; \
66
70
unsigned long __flags; \
67
71
\
68
- BUILD_BUG_ON(sizeof(_p_) != 4); \
69
- \
70
72
/* \
71
73
* spin lock/unlock provide the needed smp_mb() before/after \
72
74
*/ \
You can’t perform that action at this time.
0 commit comments