1 // SPDX-FileCopyrightText: 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3 // SPDX-License-Identifier: MIT
12 #include <urcu/config.h>
13 #include <urcu/compiler.h>
14 #include <urcu/arch.h>
16 #ifdef CONFIG_RCU_USE_ATOMIC_BUILTINS
18 #define CMM_LOAD_SHARED(x) \
19 __atomic_load_n(cmm_cast_volatile(&(x)), __ATOMIC_RELAXED)
21 #define _CMM_LOAD_SHARED(x) CMM_LOAD_SHARED(x)
23 #define CMM_STORE_SHARED(x, v) \
26 __typeof__(v) _v = (v); \
27 __atomic_store_n(cmm_cast_volatile(&(x)), _v, \
32 #define _CMM_STORE_SHARED(x, v) CMM_STORE_SHARED(x, v)
36 * Identify a shared load. A cmm_smp_rmc() or cmm_smp_mc() should come
39 #define _CMM_LOAD_SHARED(p) CMM_ACCESS_ONCE(p)
42 * Load a data from shared memory, doing a cache flush if required.
44 #define CMM_LOAD_SHARED(p) \
48 _CMM_LOAD_SHARED(p); \
52 * Identify a shared store. A cmm_smp_wmc() or cmm_smp_mc() should
55 #define _CMM_STORE_SHARED(x, v) __extension__ ({ CMM_ACCESS_ONCE(x) = (v); })
58 * Store v into x, where x is located in shared memory. Performs the
59 * required cache flush after writing. Returns v.
61 #define CMM_STORE_SHARED(x, v) \
64 __typeof__(x) _v = _CMM_STORE_SHARED(x, v); \
66 _v = _v; /* Work around clang "unused result" */ \
69 #endif /* CONFIG_RCU_USE_ATOMIC_BUILTINS */
71 #endif /* _URCU_SYSTEM_H */
This page took 0.031143 seconds and 4 git commands to generate.