FD.io VPP  v21.10.1-2-g0a485f517
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_cmp_and_swap_acq_relax(addr, exp, new, weak)
 
#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_store_seq_cst(a, b)   __atomic_store_n ((a), (b), __ATOMIC_SEQ_CST)
 
#define clib_atomic_load_seq_cst(a)   __atomic_load_n ((a), __ATOMIC_SEQ_CST)
 
#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)
 
#define clib_atomic_fetch_add_relax(a, b)   __atomic_fetch_add((a), (b), __ATOMIC_RELAXED)
 
#define clib_atomic_fetch_sub_relax(a, b)   __atomic_fetch_sub((a), (b), __ATOMIC_RELAXED)
 

Macro Definition Documentation

◆ clib_atomic_add_fetch

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

Definition at line 30 of file atomics.h.

◆ clib_atomic_and_fetch

#define clib_atomic_and_fetch (   a,
  b 
)    __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

#define clib_atomic_cmp_and_swap_acq_relax (   addr,
  exp,
  new,
  weak 
)
Value:
__atomic_compare_exchange ((addr), (exp), (new), (weak), __ATOMIC_ACQUIRE, \
__ATOMIC_RELAXED)

Definition at line 41 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 48 of file atomics.h.

◆ clib_atomic_fetch_add

#define clib_atomic_fetch_add (   a,
  b 
)    __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,
  b 
)    __atomic_fetch_add((a), (b), __ATOMIC_RELEASE)

Definition at line 60 of file atomics.h.

◆ clib_atomic_fetch_add_relax

#define clib_atomic_fetch_add_relax (   a,
  b 
)    __atomic_fetch_add((a), (b), __ATOMIC_RELAXED)

Definition at line 63 of file atomics.h.

◆ clib_atomic_fetch_and

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

Definition at line 25 of file atomics.h.

◆ clib_atomic_fetch_nand

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

Definition at line 28 of file atomics.h.

◆ clib_atomic_fetch_or

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

Definition at line 27 of file atomics.h.

◆ clib_atomic_fetch_sub

#define clib_atomic_fetch_sub (   a,
  b 
)    __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,
  b 
)    __atomic_fetch_sub((a), (b), __ATOMIC_RELEASE)

Definition at line 61 of file atomics.h.

◆ clib_atomic_fetch_sub_relax

#define clib_atomic_fetch_sub_relax (   a,
  b 
)    __atomic_fetch_sub((a), (b), __ATOMIC_RELAXED)

Definition at line 64 of file atomics.h.

◆ clib_atomic_fetch_xor

#define clib_atomic_fetch_xor (   a,
  b 
)    __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 51 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 50 of file atomics.h.

◆ clib_atomic_load_seq_cst

#define clib_atomic_load_seq_cst (   a)    __atomic_load_n ((a), __ATOMIC_SEQ_CST)

Definition at line 55 of file atomics.h.

◆ clib_atomic_nand_fetch

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

Definition at line 35 of file atomics.h.

◆ clib_atomic_or_fetch

#define clib_atomic_or_fetch (   a,
  b 
)    __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 46 of file atomics.h.

◆ clib_atomic_store_rel_n

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

Definition at line 52 of file atomics.h.

◆ clib_atomic_store_seq_cst

#define clib_atomic_store_seq_cst (   a,
  b 
)    __atomic_store_n ((a), (b), __ATOMIC_SEQ_CST)

Definition at line 53 of file atomics.h.

◆ clib_atomic_sub_fetch

#define clib_atomic_sub_fetch (   a,
  b 
)    __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,
  b 
)    __atomic_exchange_n ((a), (b), __ATOMIC_ACQUIRE)

Definition at line 57 of file atomics.h.

◆ clib_atomic_swap_rel_n

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

Definition at line 58 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 45 of file atomics.h.

◆ clib_atomic_xor_fetch

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

Definition at line 33 of file atomics.h.

exp
u8 exp
Definition: fib_types.api:27
addr
vhost_vring_addr_t addr
Definition: vhost_user.h:130