1 // SPDX-FileCopyrightText: 2009 Mathieu Desnoyers <mathieu.desnoyers (at) efficios.com> 2 // SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation. 3 // 4 // SPDX-License-Identifier: LGPL-2.1-or-later 5 6 /* 7 * library wrappers to be used by non-LGPL compatible source code. 8 * 9 * IBM's contributions to this file may be relicensed under LGPLv2 or later. 10 */ 11 12 #include <urcu/uatomic.h> 13 14 #include <urcu/static/pointer.h> 15 /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ 16 #include <urcu/pointer.h> 17 18 extern void synchronize_rcu(void); 19 20 void *rcu_dereference_sym(void *p) 21 { 22 return _rcu_dereference(p); 23 } 24 25 void *rcu_set_pointer_sym(void **p, void *v) 26 { 27 uatomic_store(p, v, CMM_RELEASE); 28 return v; 29 } 30 31 void *rcu_xchg_pointer_sym(void **p, void *v) 32 { 33 return uatomic_xchg_mo(p, v, CMM_SEQ_CST); 34 } 35 36 void *rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new) 37 { 38 return uatomic_cmpxchg_mo(p, old, _new, CMM_SEQ_CST, CMM_RELAXED); 39 } 40