#include <linux/compiler.h>
#include <linux/types.h>
#include <asm/cmpxchg.h>
Go to the source code of this file.
|
#define | ATOMIC_INIT(i) { (i) } |
|
#define | __CS_LOOP(ptr, op_val, op_string) |
|
#define | atomic_add(_i, _v) atomic_add_return(_i, _v) |
|
#define | atomic_add_negative(_i, _v) (atomic_add_return(_i, _v) < 0) |
|
#define | atomic_inc(_v) atomic_add_return(1, _v) |
|
#define | atomic_inc_return(_v) atomic_add_return(1, _v) |
|
#define | atomic_inc_and_test(_v) (atomic_add_return(1, _v) == 0) |
|
#define | atomic_sub(_i, _v) atomic_sub_return(_i, _v) |
|
#define | atomic_sub_and_test(_i, _v) (atomic_sub_return(_i, _v) == 0) |
|
#define | atomic_dec(_v) atomic_sub_return(1, _v) |
|
#define | atomic_dec_return(_v) atomic_sub_return(1, _v) |
|
#define | atomic_dec_and_test(_v) (atomic_sub_return(1, _v) == 0) |
|
#define | atomic_xchg(v, new) (xchg(&((v)->counter), new)) |
|
#define | ATOMIC64_INIT(i) { (i) } |
|
#define | atomic64_add(_i, _v) atomic64_add_return(_i, _v) |
|
#define | atomic64_add_negative(_i, _v) (atomic64_add_return(_i, _v) < 0) |
|
#define | atomic64_inc(_v) atomic64_add_return(1, _v) |
|
#define | atomic64_inc_return(_v) atomic64_add_return(1, _v) |
|
#define | atomic64_inc_and_test(_v) (atomic64_add_return(1, _v) == 0) |
|
#define | atomic64_sub(_i, _v) atomic64_sub_return(_i, _v) |
|
#define | atomic64_sub_and_test(_i, _v) (atomic64_sub_return(_i, _v) == 0) |
|
#define | atomic64_dec(_v) atomic64_sub_return(1, _v) |
|
#define | atomic64_dec_return(_v) atomic64_sub_return(1, _v) |
|
#define | atomic64_dec_and_test(_v) (atomic64_sub_return(1, _v) == 0) |
|
#define | atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) |
|
#define | smp_mb__before_atomic_dec() smp_mb() |
|
#define | smp_mb__after_atomic_dec() smp_mb() |
|
#define | smp_mb__before_atomic_inc() smp_mb() |
|
#define | smp_mb__after_atomic_inc() smp_mb() |
|
#define __CS_LOOP |
( |
|
ptr, |
|
|
|
op_val, |
|
|
|
op_string |
|
) |
| |
Value:({ \
int old_val, new_val; \
asm volatile( \
" l %0,%2\n" \
"0: lr %1,%0\n" \
op_string " %1,%3\n" \
" cs %0,%1,%2\n" \
" jl 0b" \
: "=&d" (old_val), "=&d" (new_val), \
: "cc", "memory"); \
new_val; \
})
Definition at line 22 of file atomic.h.
#define ATOMIC64_INIT |
( |
|
i | ) |
{ (i) } |
#define ATOMIC_INIT |
( |
|
i | ) |
{ (i) } |
#define smp_mb__after_atomic_dec |
( |
| ) |
smp_mb() |
#define smp_mb__after_atomic_inc |
( |
| ) |
smp_mb() |
#define smp_mb__before_atomic_dec |
( |
| ) |
smp_mb() |
#define smp_mb__before_atomic_inc |
( |
| ) |
smp_mb() |