FD.io VPP  v20.01-9-g24064d02a
Vector Packet Processing
atomics.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define clib_atomic_fetch_add(a, b)   __sync_fetch_and_add(a, b)
 
#define clib_atomic_fetch_sub(a, b)   __sync_fetch_and_sub(a, b)
 
#define clib_atomic_fetch_and(a, b)   __sync_fetch_and_and(a, b)
 
#define clib_atomic_fetch_xor(a, b)   __sync_fetch_and_xor(a, b)
 
#define clib_atomic_fetch_or(a, b)   __sync_fetch_and_or(a, b)
 
#define clib_atomic_fetch_nand(a, b)   __sync_fetch_nand(a, b)
 
#define clib_atomic_add_fetch(a, b)   __sync_add_and_fetch(a, b)
 
#define clib_atomic_sub_fetch(a, b)   __sync_sub_and_fetch(a, b)
 
#define clib_atomic_and_fetch(a, b)   __sync_and_and_fetch(a, b)
 
#define clib_atomic_xor_fetch(a, b)   __sync_xor_and_fetch(a, b)
 
#define clib_atomic_or_fetch(a, b)   __sync_or_and_fetch(a, b)
 
#define clib_atomic_nand_fetch(a, b)   __sync_nand_and_fetch(a, b)
 
#define clib_atomic_cmp_and_swap(addr, old, new)   __sync_val_compare_and_swap(addr, old, new)
 
#define clib_atomic_bool_cmp_and_swap(addr, old, new)   __sync_bool_compare_and_swap(addr, old, new)
 
#define clib_atomic_cmp_and_swap_acq_relax_n(addr, exp, new, weak)   __atomic_compare_exchange_n ((addr), (exp), (new), (weak), __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)
 
#define clib_atomic_test_and_set(a)   __atomic_exchange_n(a, 1, __ATOMIC_ACQUIRE)
 
#define clib_atomic_release(a)   __atomic_store_n(a, 0, __ATOMIC_RELEASE)
 
#define clib_atomic_fence_rel()   __atomic_thread_fence(__ATOMIC_RELEASE);
 
#define clib_atomic_load_relax_n(a)   __atomic_load_n((a), __ATOMIC_RELAXED)
 
#define clib_atomic_load_acq_n(a)   __atomic_load_n((a), __ATOMIC_ACQUIRE)
 
#define clib_atomic_store_rel_n(a, b)   __atomic_store_n ((a), (b), __ATOMIC_RELEASE)
 
#define clib_atomic_swap_acq_n(a, b)   __atomic_exchange_n ((a), (b), __ATOMIC_ACQUIRE)
 
#define clib_atomic_swap_rel_n(a, b)   __atomic_exchange_n ((a), (b), __ATOMIC_RELEASE)
 
#define clib_atomic_fetch_add_rel(a, b)   __atomic_fetch_add((a), (b), __ATOMIC_RELEASE)
 
#define clib_atomic_fetch_sub_rel(a, b)   __atomic_fetch_sub((a), (b), __ATOMIC_RELEASE)
 

Macro Definition Documentation

◆ clib_atomic_add_fetch

#define clib_atomic_add_fetch (   a,
 
)    __sync_add_and_fetch(a, b)

Definition at line 30 of file atomics.h.

◆ clib_atomic_and_fetch

#define clib_atomic_and_fetch (   a,
 
)    __sync_and_and_fetch(a, b)

Definition at line 32 of file atomics.h.

◆ clib_atomic_bool_cmp_and_swap

#define clib_atomic_bool_cmp_and_swap (   addr,
  old,
  new 
)    __sync_bool_compare_and_swap(addr, old, new)

Definition at line 38 of file atomics.h.

◆ clib_atomic_cmp_and_swap

#define clib_atomic_cmp_and_swap (   addr,
  old,
  new 
)    __sync_val_compare_and_swap(addr, old, new)

Definition at line 37 of file atomics.h.

◆ clib_atomic_cmp_and_swap_acq_relax_n

#define clib_atomic_cmp_and_swap_acq_relax_n (   addr,
  exp,
  new,
  weak 
)    __atomic_compare_exchange_n ((addr), (exp), (new), (weak), __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)

Definition at line 40 of file atomics.h.

◆ clib_atomic_fence_rel

#define clib_atomic_fence_rel ( )    __atomic_thread_fence(__ATOMIC_RELEASE);

Definition at line 45 of file atomics.h.

◆ clib_atomic_fetch_add

#define clib_atomic_fetch_add (   a,
 
)    __sync_fetch_and_add(a, b)

Definition at line 23 of file atomics.h.

◆ clib_atomic_fetch_add_rel

#define clib_atomic_fetch_add_rel (   a,
 
)    __atomic_fetch_add((a), (b), __ATOMIC_RELEASE)

Definition at line 54 of file atomics.h.

◆ clib_atomic_fetch_and

#define clib_atomic_fetch_and (   a,
 
)    __sync_fetch_and_and(a, b)

Definition at line 25 of file atomics.h.

◆ clib_atomic_fetch_nand

#define clib_atomic_fetch_nand (   a,
 
)    __sync_fetch_nand(a, b)

Definition at line 28 of file atomics.h.

◆ clib_atomic_fetch_or

#define clib_atomic_fetch_or (   a,
 
)    __sync_fetch_and_or(a, b)

Definition at line 27 of file atomics.h.

◆ clib_atomic_fetch_sub

#define clib_atomic_fetch_sub (   a,
 
)    __sync_fetch_and_sub(a, b)

Definition at line 24 of file atomics.h.

◆ clib_atomic_fetch_sub_rel

#define clib_atomic_fetch_sub_rel (   a,
 
)    __atomic_fetch_sub((a), (b), __ATOMIC_RELEASE)

Definition at line 55 of file atomics.h.

◆ clib_atomic_fetch_xor

#define clib_atomic_fetch_xor (   a,
 
)    __sync_fetch_and_xor(a, b)

Definition at line 26 of file atomics.h.

◆ clib_atomic_load_acq_n

#define clib_atomic_load_acq_n (   a)    __atomic_load_n((a), __ATOMIC_ACQUIRE)

Definition at line 48 of file atomics.h.

◆ clib_atomic_load_relax_n

#define clib_atomic_load_relax_n (   a)    __atomic_load_n((a), __ATOMIC_RELAXED)

Definition at line 47 of file atomics.h.

◆ clib_atomic_nand_fetch

#define clib_atomic_nand_fetch (   a,
 
)    __sync_nand_and_fetch(a, b)

Definition at line 35 of file atomics.h.

◆ clib_atomic_or_fetch

#define clib_atomic_or_fetch (   a,
 
)    __sync_or_and_fetch(a, b)

Definition at line 34 of file atomics.h.

◆ clib_atomic_release

#define clib_atomic_release (   a)    __atomic_store_n(a, 0, __ATOMIC_RELEASE)

Definition at line 43 of file atomics.h.

◆ clib_atomic_store_rel_n

#define clib_atomic_store_rel_n (   a,
 
)    __atomic_store_n ((a), (b), __ATOMIC_RELEASE)

Definition at line 49 of file atomics.h.

◆ clib_atomic_sub_fetch

#define clib_atomic_sub_fetch (   a,
 
)    __sync_sub_and_fetch(a, b)

Definition at line 31 of file atomics.h.

◆ clib_atomic_swap_acq_n

#define clib_atomic_swap_acq_n (   a,
 
)    __atomic_exchange_n ((a), (b), __ATOMIC_ACQUIRE)

Definition at line 51 of file atomics.h.

◆ clib_atomic_swap_rel_n

#define clib_atomic_swap_rel_n (   a,
 
)    __atomic_exchange_n ((a), (b), __ATOMIC_RELEASE)

Definition at line 52 of file atomics.h.

◆ clib_atomic_test_and_set

#define clib_atomic_test_and_set (   a)    __atomic_exchange_n(a, 1, __ATOMIC_ACQUIRE)

Definition at line 42 of file atomics.h.

◆ clib_atomic_xor_fetch

#define clib_atomic_xor_fetch (   a,
 
)    __sync_xor_and_fetch(a, b)

Definition at line 33 of file atomics.h.