Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
atomic.h File Reference
#include <linux/compiler.h>
#include <linux/types.h>
#include <asm/cmpxchg.h>
#include <arch/atomic.h>

Go to the source code of this file.

Macros

#define ATOMIC_INIT(i)   { (i) }
 
#define atomic_read(v)   (*(volatile int *)&(v)->counter)
 
#define atomic_set(v, i)   (((v)->counter) = (i))
 
#define atomic_add_negative(a, v)   (atomic_add_return((a), (v)) < 0)
 
#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()
 

Macro Definition Documentation

#define atomic_add_negative (   a,
  v 
)    (atomic_add_return((a), (v)) < 0)

Definition at line 49 of file atomic.h.

#define ATOMIC_INIT (   i)    { (i) }

Definition at line 16 of file atomic.h.

#define atomic_read (   v)    (*(volatile int *)&(v)->counter)

Definition at line 18 of file atomic.h.

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

Definition at line 19 of file atomic.h.

#define atomic_xchg (   v,
  new 
)    (xchg(&((v)->counter), new))

Definition at line 139 of file atomic.h.

#define smp_mb__after_atomic_dec ( )    barrier()

Definition at line 156 of file atomic.h.

#define smp_mb__after_atomic_inc ( )    barrier()

Definition at line 158 of file atomic.h.

#define smp_mb__before_atomic_dec ( )    barrier()

Definition at line 155 of file atomic.h.

#define smp_mb__before_atomic_inc ( )    barrier()

Definition at line 157 of file atomic.h.