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

Go to the source code of this file.

Data Structures

struct  local_t
 

Macros

#define LOCAL_INIT(i)   { (i) }
 
#define local_read(l)   ((l)->counter)
 
#define local_set(l, i)   (((l)->counter) = (i))
 
#define local_add(i, l)   ((void) local_add_return((i), (l)))
 
#define local_sub(i, l)   ((void) local_sub_return((i), (l)))
 
#define local_sub_and_test(i, l)   (local_sub_return((i), (l)) == 0)
 
#define local_inc(l)   ((void)local_inc_return(l))
 
#define local_dec(l)   ((void)local_dec_return(l))
 
#define local_inc_and_test(l)   (local_inc_return(l) == 0)
 
#define local_dec_and_test(l)   (local_dec_return(l) == 0)
 
#define local_add_negative(i, l)   (local_add_return((i), (l)) < 0)
 
#define local_cmpxchg(l, o, n)   (cmpxchg_local(&((l)->counter), (o), (n)))
 
#define local_xchg(v, new)   (xchg_local(&((l)->counter), new))
 
#define local_inc_not_zero(l)   local_add_unless((l), 1, 0)
 
#define smp_mb__before_local_dec()   barrier()
 
#define smp_mb__after_local_dec()   barrier()
 
#define smp_mb__before_local_inc()   barrier()
 
#define smp_mb__after_local_inc()   barrier()
 
#define __local_inc(l)   ((l)->a.counter++)
 
#define __local_dec(l)   ((l)->a.counter++)
 
#define __local_add(i, l)   ((l)->a.counter += (i))
 
#define __local_sub(i, l)   ((l)->a.counter -= (i))
 

Macro Definition Documentation

#define __local_add (   i,
  l 
)    ((l)->a.counter += (i))

Definition at line 332 of file local.h.

#define __local_dec (   l)    ((l)->a.counter++)

Definition at line 331 of file local.h.

#define __local_inc (   l)    ((l)->a.counter++)

Definition at line 330 of file local.h.

#define __local_sub (   i,
  l 
)    ((l)->a.counter -= (i))

Definition at line 333 of file local.h.

#define local_add (   i,
  l 
)    ((void) local_add_return((i), (l)))

local_add - add long to local variable : long value to add : pointer of type local_t

Atomically adds to .

Definition at line 117 of file local.h.

#define local_add_negative (   i,
  l 
)    (local_add_return((i), (l)) < 0)

local_add_negative - add and test if negative : pointer of type local_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 244 of file local.h.

#define local_cmpxchg (   l,
  o,
  n 
)    (cmpxchg_local(&((l)->counter), (o), (n)))

Definition at line 246 of file local.h.

#define local_dec (   l)    ((void)local_dec_return(l))

local_dec - decrement local variable : pointer of type local_t

Atomically decrements by 1.

Definition at line 213 of file local.h.

#define local_dec_and_test (   l)    (local_dec_return(l) == 0)

local_dec_and_test - decrement and test : pointer of type local_t

Atomically decrements by 1 and returns true if the result is 0, or false for all other cases.

Definition at line 233 of file local.h.

#define local_inc (   l)    ((void)local_inc_return(l))

local_inc - increment local variable : pointer of type local_t

Atomically increments by 1.

Definition at line 205 of file local.h.

#define local_inc_and_test (   l)    (local_inc_return(l) == 0)

local_inc_and_test - increment and test : pointer of type local_t

Atomically increments by 1 and returns true if the result is zero, or false for all other cases.

Definition at line 223 of file local.h.

#define local_inc_not_zero (   l)    local_add_unless((l), 1, 0)

Definition at line 273 of file local.h.

#define LOCAL_INIT (   i)    { (i) }

Definition at line 29 of file local.h.

#define local_read (   l)    ((l)->counter)

local_read - read local variable : pointer of type local_t

Atomically reads the value of .

Definition at line 37 of file local.h.

#define local_set (   l,
  i 
)    (((l)->counter) = (i))

local_set - set local variable : pointer of type local_t : required value

Atomically sets the value of to .

Definition at line 46 of file local.h.

#define local_sub (   i,
  l 
)    ((void) local_sub_return((i), (l)))

local_sub - subtract the local variable : long value to subtract : pointer of type local_t

Atomically subtracts from .

Definition at line 126 of file local.h.

#define local_sub_and_test (   i,
  l 
)    (local_sub_return((i), (l)) == 0)

local_sub_and_test - subtract value from variable and test result : integer value to subtract : pointer of type local_t

Atomically subtracts from and returns true if the result is zero, or false for all other cases.

Definition at line 137 of file local.h.

#define local_xchg (   v,
  new 
)    (xchg_local(&((l)->counter), new))

Definition at line 247 of file local.h.

#define smp_mb__after_local_dec ( )    barrier()

Definition at line 321 of file local.h.

#define smp_mb__after_local_inc ( )    barrier()

Definition at line 323 of file local.h.

#define smp_mb__before_local_dec ( )    barrier()

Definition at line 320 of file local.h.

#define smp_mb__before_local_inc ( )    barrier()

Definition at line 322 of file local.h.