diff options
author | Peter Zijlstra <peterz@infradead.org> | 2013-11-08 06:01:59 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-01-12 04:37:14 -0500 |
commit | 1de7da377bd880ff23917f78924d0e908329d978 (patch) | |
tree | 38700ceabb6050598f3800032617d5c73d7344b8 /arch | |
parent | 2e4f5382d12a441b5cccfdde00308df15c2ce300 (diff) |
arch: Move smp_mb__{before,after}_atomic_{inc,dec}.h into asm/atomic.h
Move the barriers functions that depend on the atomic implementation
into the atomic implementation.
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Vineet Gupta <vgupta@synopsys.com> [for arch/arc bits]
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20131213150640.786183683@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arc/include/asm/atomic.h | 5 | ||||
-rw-r--r-- | arch/arc/include/asm/barrier.h | 5 | ||||
-rw-r--r-- | arch/hexagon/include/asm/atomic.h | 6 | ||||
-rw-r--r-- | arch/hexagon/include/asm/barrier.h | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/arch/arc/include/asm/atomic.h b/arch/arc/include/asm/atomic.h index 83f03ca6caf6..03e494f695d1 100644 --- a/arch/arc/include/asm/atomic.h +++ b/arch/arc/include/asm/atomic.h | |||
@@ -190,6 +190,11 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) | |||
190 | 190 | ||
191 | #endif /* !CONFIG_ARC_HAS_LLSC */ | 191 | #endif /* !CONFIG_ARC_HAS_LLSC */ |
192 | 192 | ||
193 | #define smp_mb__before_atomic_dec() barrier() | ||
194 | #define smp_mb__after_atomic_dec() barrier() | ||
195 | #define smp_mb__before_atomic_inc() barrier() | ||
196 | #define smp_mb__after_atomic_inc() barrier() | ||
197 | |||
193 | /** | 198 | /** |
194 | * __atomic_add_unless - add unless the number is a given value | 199 | * __atomic_add_unless - add unless the number is a given value |
195 | * @v: pointer of type atomic_t | 200 | * @v: pointer of type atomic_t |
diff --git a/arch/arc/include/asm/barrier.h b/arch/arc/include/asm/barrier.h index f6cb7c4ffb35..c32245c3d1e9 100644 --- a/arch/arc/include/asm/barrier.h +++ b/arch/arc/include/asm/barrier.h | |||
@@ -30,11 +30,6 @@ | |||
30 | #define smp_wmb() barrier() | 30 | #define smp_wmb() barrier() |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | #define smp_mb__before_atomic_dec() barrier() | ||
34 | #define smp_mb__after_atomic_dec() barrier() | ||
35 | #define smp_mb__before_atomic_inc() barrier() | ||
36 | #define smp_mb__after_atomic_inc() barrier() | ||
37 | |||
38 | #define smp_read_barrier_depends() do { } while (0) | 33 | #define smp_read_barrier_depends() do { } while (0) |
39 | 34 | ||
40 | #endif | 35 | #endif |
diff --git a/arch/hexagon/include/asm/atomic.h b/arch/hexagon/include/asm/atomic.h index 8a64ff2337f6..7aae4cb2a29a 100644 --- a/arch/hexagon/include/asm/atomic.h +++ b/arch/hexagon/include/asm/atomic.h | |||
@@ -160,8 +160,12 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) | |||
160 | #define atomic_sub_and_test(i, v) (atomic_sub_return(i, (v)) == 0) | 160 | #define atomic_sub_and_test(i, v) (atomic_sub_return(i, (v)) == 0) |
161 | #define atomic_add_negative(i, v) (atomic_add_return(i, (v)) < 0) | 161 | #define atomic_add_negative(i, v) (atomic_add_return(i, (v)) < 0) |
162 | 162 | ||
163 | |||
164 | #define atomic_inc_return(v) (atomic_add_return(1, v)) | 163 | #define atomic_inc_return(v) (atomic_add_return(1, v)) |
165 | #define atomic_dec_return(v) (atomic_sub_return(1, v)) | 164 | #define atomic_dec_return(v) (atomic_sub_return(1, v)) |
166 | 165 | ||
166 | #define smp_mb__before_atomic_dec() barrier() | ||
167 | #define smp_mb__after_atomic_dec() barrier() | ||
168 | #define smp_mb__before_atomic_inc() barrier() | ||
169 | #define smp_mb__after_atomic_inc() barrier() | ||
170 | |||
167 | #endif | 171 | #endif |
diff --git a/arch/hexagon/include/asm/barrier.h b/arch/hexagon/include/asm/barrier.h index 1041a8e70ce8..4e863daea25b 100644 --- a/arch/hexagon/include/asm/barrier.h +++ b/arch/hexagon/include/asm/barrier.h | |||
@@ -29,10 +29,6 @@ | |||
29 | #define smp_read_barrier_depends() barrier() | 29 | #define smp_read_barrier_depends() barrier() |
30 | #define smp_wmb() barrier() | 30 | #define smp_wmb() barrier() |
31 | #define smp_mb() barrier() | 31 | #define smp_mb() barrier() |
32 | #define smp_mb__before_atomic_dec() barrier() | ||
33 | #define smp_mb__after_atomic_dec() barrier() | ||
34 | #define smp_mb__before_atomic_inc() barrier() | ||
35 | #define smp_mb__after_atomic_inc() barrier() | ||
36 | 32 | ||
37 | /* Set a value and use a memory barrier. Used by the scheduler somewhere. */ | 33 | /* Set a value and use a memory barrier. Used by the scheduler somewhere. */ |
38 | #define set_mb(var, value) \ | 34 | #define set_mb(var, value) \ |