#include <linux/types.h>
#include <asm/assembler.h>
#include <asm/cmpxchg.h>
#include <asm/dcache_clear.h>
Go to the source code of this file.
|
#define | ATOMIC_INIT(i) { (i) } |
|
#define | atomic_read(v) (*(volatile int *)&(v)->counter) |
|
#define | atomic_set(v, i) (((v)->counter) = (i)) |
|
#define | atomic_add(i, v) ((void) atomic_add_return((i), (v))) |
|
#define | atomic_sub(i, v) ((void) atomic_sub_return((i), (v))) |
|
#define | atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0) |
|
#define | atomic_inc(v) ((void)atomic_inc_return(v)) |
|
#define | atomic_dec(v) ((void)atomic_dec_return(v)) |
|
#define | atomic_inc_and_test(v) (atomic_inc_return(v) == 0) |
|
#define | atomic_dec_and_test(v) (atomic_dec_return(v) == 0) |
|
#define | atomic_add_negative(i, v) (atomic_add_return((i), (v)) < 0) |
|
#define | atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) |
|
#define | atomic_xchg(v, new) (xchg(&((v)->counter), new)) |
|
#define | smp_mb__before_atomic_dec() barrier() |
|
#define | smp_mb__after_atomic_dec() barrier() |
|
#define | smp_mb__before_atomic_inc() barrier() |
|
#define | smp_mb__after_atomic_inc() barrier() |
|
atomic_add - add integer to atomic variable : integer value to add : pointer of type atomic_t
Atomically adds to .
Definition at line 110 of file atomic.h.
atomic_add_negative - add and test if negative : pointer of type atomic_t : integer value to add
Atomically adds to and returns true if the result is negative, or false when result is greater than or equal to zero.
Definition at line 237 of file atomic.h.
atomic_dec_and_test - decrement and test : pointer of type atomic_t
Atomically decrements by 1 and returns true if the result is 0, or false for all other cases.
Definition at line 226 of file atomic.h.
atomic_inc_and_test - increment and test : pointer of type atomic_t
Atomically increments by 1 and returns true if the result is zero, or false for all other cases.
Definition at line 216 of file atomic.h.
#define ATOMIC_INIT |
( |
|
i | ) |
{ (i) } |
atomic_sub - subtract the atomic variable : integer value to subtract : pointer of type atomic_t
Atomically subtracts from .
Definition at line 119 of file atomic.h.
atomic_sub_and_test - subtract value from variable and test result : integer value to subtract : pointer of type atomic_t
Atomically subtracts from and returns true if the result is zero, or false for all other cases.
Definition at line 130 of file atomic.h.
#define smp_mb__after_atomic_dec |
( |
| ) |
barrier() |
#define smp_mb__after_atomic_inc |
( |
| ) |
barrier() |
#define smp_mb__before_atomic_dec |
( |
| ) |
barrier() |
#define smp_mb__before_atomic_inc |
( |
| ) |
barrier() |