| 1 | /* |
| 2 | * SPDX-License-Identifier: LGPL-2.1-or-later |
| 3 | * |
| 4 | * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 5 | * Copyright (c) 2009 Paul E. McKenney, IBM Corporation. |
| 6 | * |
| 7 | * library wrappers to be used by non-LGPL compatible source code. |
| 8 | */ |
| 9 | |
| 10 | #include <urcu/uatomic.h> |
| 11 | |
| 12 | #include <lttng/urcu/static/pointer.h> |
| 13 | /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ |
| 14 | #include <lttng/urcu/pointer.h> |
| 15 | |
| 16 | void *lttng_ust_rcu_dereference_sym(void *p) |
| 17 | { |
| 18 | return _lttng_ust_rcu_dereference(p); |
| 19 | } |
| 20 | |
| 21 | void *lttng_ust_rcu_set_pointer_sym(void **p, void *v) |
| 22 | { |
| 23 | cmm_wmb(); |
| 24 | uatomic_set(p, v); |
| 25 | return v; |
| 26 | } |
| 27 | |
| 28 | void *lttng_ust_rcu_xchg_pointer_sym(void **p, void *v) |
| 29 | { |
| 30 | cmm_wmb(); |
| 31 | return uatomic_xchg(p, v); |
| 32 | } |
| 33 | |
| 34 | void *lttng_ust_rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new) |
| 35 | { |
| 36 | cmm_wmb(); |
| 37 | return uatomic_cmpxchg(p, old, _new); |
| 38 | } |