Go to the documentation of this file.
17 #ifndef _ASM_TILE_ATOMIC_32_H
18 #define _ASM_TILE_ATOMIC_32_H
20 #include <asm/barrier.h>
120 #define ATOMIC64_INIT(val) { (val) }
226 #define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0)
227 #define atomic64_inc(v) atomic64_add(1LL, (v))
228 #define atomic64_inc_return(v) atomic64_add_return(1LL, (v))
229 #define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)
230 #define atomic64_sub_return(i, v) atomic64_add_return(-(i), (v))
231 #define atomic64_sub_and_test(a, v) (atomic64_sub_return((a), (v)) == 0)
232 #define atomic64_sub(i, v) atomic64_add(-(i), (v))
233 #define atomic64_dec(v) atomic64_sub(1LL, (v))
234 #define atomic64_dec_return(v) atomic64_sub_return(1LL, (v))
235 #define atomic64_dec_and_test(v) (atomic64_dec_return((v)) == 0)
236 #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1LL, 0LL)
244 #define smp_mb__before_atomic_dec() smp_mb()
245 #define smp_mb__before_atomic_inc() smp_mb()
246 #define smp_mb__after_atomic_dec() do { } while (0)
247 #define smp_mb__after_atomic_inc() do { } while (0)
255 #define ATOMIC_LOCKS_FOUND_VIA_TABLE() \
256 (!CHIP_HAS_CBOX_HOME_MAP() && defined(CONFIG_SMP))
258 #if ATOMIC_LOCKS_FOUND_VIA_TABLE()
261 #define ATOMIC_HASH_L1_SHIFT 6
262 #define ATOMIC_HASH_L1_SIZE (1 << ATOMIC_HASH_L1_SHIFT)
265 #define ATOMIC_HASH_L2_SHIFT (CHIP_L2_LOG_LINE_SIZE() - 2)
266 #define ATOMIC_HASH_L2_SIZE (1 << ATOMIC_HASH_L2_SHIFT)
277 #define ATOMIC_HASH_SHIFT (PAGE_SHIFT - 3)
278 #define ATOMIC_HASH_SIZE (1 << ATOMIC_HASH_SHIFT)
294 #define ATOMIC_LOCK_REG 20
295 #define ATOMIC_LOCK_REG_NAME r20
303 void __atomic_fault_unlock(
int *lock_ptr);
315 int *
lock,
int o,
int n);
319 int *
lock,
int o,
int n);