2005/5/9

     
 

core_atomicop_linux_h

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

core_atomicop_linux.h File Reference


Compounds

struct  atomic_t

Defines

#define LOCK   lock ;
#define ATOMIC_INIT(i)   { (i) }
#define atomic_read(v)   ((v)->counter)
 atomic_read - read atomic variable : pointer of type atomic_t

#define atomic_set(v, i)   (((v)->counter) = (i))
 atomic_set - set atomic variable : pointer of type atomic_t : required value

#define atomic_clear_mask(mask, addr)
#define atomic_set_mask(mask, addr)
#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()

Functions

__inline__ void atomic_add (int i, atomic_t *v)
 atomic_add - add integer to atomic variable : integer value to add : pointer of type atomic_t

__inline__ void atomic_sub (int i, atomic_t *v)
 atomic_sub - subtract the atomic variable : integer value to subtract : pointer of type atomic_t

__inline__ int atomic_sub_and_test (int i, atomic_t *v)
 atomic_sub_and_test - subtract value from variable and test result : integer value to subtract : pointer of type atomic_t

__inline__ void atomic_inc (atomic_t *v)
 atomic_inc - increment atomic variable : pointer of type atomic_t

__inline__ void atomic_dec (atomic_t *v)
 atomic_dec - decrement atomic variable : pointer of type atomic_t

__inline__ int atomic_dec_and_test (atomic_t *v)
 atomic_dec_and_test - decrement and test : pointer of type atomic_t

__inline__ int atomic_inc_and_test (atomic_t *v)
 atomic_inc_and_test - increment and test : pointer of type atomic_t

__inline__ int atomic_add_negative (int i, atomic_t *v)
 atomic_add_negative - add and test if negative : pointer of type atomic_t : integer value to add


Define Documentation

#define atomic_clear_mask mask,
addr   ) 
 

Value:

__asm__ __volatile__(LOCK andl %0,%1 \
: : r (~(mask)),m (*addr) : memory)

#define ATOMIC_INIT  )     { (i) }
 

#define atomic_read  )     ((v)->counter)
 

atomic_read - read atomic variable : pointer of type atomic_t

Atomically reads the value of . Note that the guaranteed useful range of an atomic_t is only 24 bits.

#define atomic_set v,
 )     (((v)->counter) = (i))
 

atomic_set - set atomic variable : pointer of type atomic_t : required value

Atomically sets the value of to . Note that the guaranteed useful range of an atomic_t is only 24 bits.

#define atomic_set_mask mask,
addr   ) 
 

Value:

__asm__ __volatile__(LOCK orl %0,%1 \
: : r (mask),m (*addr) : memory)

#define LOCK   lock ;
 

 
#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()
 


Function Documentation

__inline__ void atomic_add int  i,
atomic_t v
[static]
 

atomic_add - add integer to atomic variable : integer value to add : pointer of type atomic_t

Atomically adds to . Note that the guaranteed useful range of an atomic_t is only 24 bits.

__inline__ int atomic_add_negative int  i,
atomic_t v
[static]
 

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. Note that the guaranteed useful range of an atomic_t is only 24 bits.

__inline__ void atomic_dec atomic_t v  )  [static]
 

atomic_dec - decrement atomic variable : pointer of type atomic_t

Atomically decrements by 1. Note that the guaranteed useful range of an atomic_t is only 24 bits.

__inline__ int atomic_dec_and_test atomic_t v  )  [static]
 

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. Note that the guaranteed useful range of an atomic_t is only 24 bits.

__inline__ void atomic_inc atomic_t v  )  [static]
 

atomic_inc - increment atomic variable : pointer of type atomic_t

Atomically increments by 1. Note that the guaranteed useful range of an atomic_t is only 24 bits.

__inline__ int atomic_inc_and_test atomic_t v  )  [static]
 

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. Note that the guaranteed useful range of an atomic_t is only 24 bits.

__inline__ void atomic_sub int  i,
atomic_t v
[static]
 

atomic_sub - subtract the atomic variable : integer value to subtract : pointer of type atomic_t

Atomically subtracts from . Note that the guaranteed useful range of an atomic_t is only 24 bits.

__inline__ int atomic_sub_and_test int  i,
atomic_t v
[static]
 

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. Note that the guaranteed useful range of an atomic_t is only 24 bits.