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

Go to the source code of this file.

Data Structures

struct  atomic64_t
 

Macros

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

Variables

typedef __attribute__
 

Macro Definition Documentation

#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), \
"=Q" (((atomic_t *)(ptr))->counter) \
: "d" (op_val), "Q" (((atomic_t *)(ptr))->counter) \
: "cc", "memory"); \
new_val; \
})

Definition at line 22 of file atomic.h.

#define atomic64_add (   _i,
  _v 
)    atomic64_add_return(_i, _v)

Definition at line 317 of file atomic.h.

#define atomic64_add_negative (   _i,
  _v 
)    (atomic64_add_return(_i, _v) < 0)

Definition at line 318 of file atomic.h.

#define atomic64_dec (   _v)    atomic64_sub_return(1, _v)

Definition at line 324 of file atomic.h.

#define atomic64_dec_and_test (   _v)    (atomic64_sub_return(1, _v) == 0)

Definition at line 326 of file atomic.h.

#define atomic64_dec_return (   _v)    atomic64_sub_return(1, _v)

Definition at line 325 of file atomic.h.

#define atomic64_inc (   _v)    atomic64_add_return(1, _v)

Definition at line 319 of file atomic.h.

#define atomic64_inc_and_test (   _v)    (atomic64_add_return(1, _v) == 0)

Definition at line 321 of file atomic.h.

#define atomic64_inc_not_zero (   v)    atomic64_add_unless((v), 1, 0)

Definition at line 327 of file atomic.h.

#define atomic64_inc_return (   _v)    atomic64_add_return(1, _v)

Definition at line 320 of file atomic.h.

#define ATOMIC64_INIT (   i)    { (i) }

Definition at line 114 of file atomic.h.

#define atomic64_sub (   _i,
  _v 
)    atomic64_sub_return(_i, _v)

Definition at line 322 of file atomic.h.

#define atomic64_sub_and_test (   _i,
  _v 
)    (atomic64_sub_return(_i, _v) == 0)

Definition at line 323 of file atomic.h.

#define atomic_add (   _i,
  _v 
)    atomic_add_return(_i, _v)

Definition at line 58 of file atomic.h.

#define atomic_add_negative (   _i,
  _v 
)    (atomic_add_return(_i, _v) < 0)

Definition at line 59 of file atomic.h.

#define atomic_dec (   _v)    atomic_sub_return(1, _v)

Definition at line 70 of file atomic.h.

#define atomic_dec_and_test (   _v)    (atomic_sub_return(1, _v) == 0)

Definition at line 72 of file atomic.h.

#define atomic_dec_return (   _v)    atomic_sub_return(1, _v)

Definition at line 71 of file atomic.h.

#define atomic_inc (   _v)    atomic_add_return(1, _v)

Definition at line 60 of file atomic.h.

#define atomic_inc_and_test (   _v)    (atomic_add_return(1, _v) == 0)

Definition at line 62 of file atomic.h.

#define atomic_inc_return (   _v)    atomic_add_return(1, _v)

Definition at line 61 of file atomic.h.

#define ATOMIC_INIT (   i)    { (i) }

Definition at line 20 of file atomic.h.

#define atomic_sub (   _i,
  _v 
)    atomic_sub_return(_i, _v)

Definition at line 68 of file atomic.h.

#define atomic_sub_and_test (   _i,
  _v 
)    (atomic_sub_return(_i, _v) == 0)

Definition at line 69 of file atomic.h.

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

Definition at line 84 of file atomic.h.

#define smp_mb__after_atomic_dec ( )    smp_mb()

Definition at line 330 of file atomic.h.

#define smp_mb__after_atomic_inc ( )    smp_mb()

Definition at line 332 of file atomic.h.

#define smp_mb__before_atomic_dec ( )    smp_mb()

Definition at line 329 of file atomic.h.

#define smp_mb__before_atomic_inc ( )    smp_mb()

Definition at line 331 of file atomic.h.

Variable Documentation

typedef __attribute__