1 #ifndef _LTTNG_TRACEPOINT_RCU_H
2 #define _LTTNG_TRACEPOINT_RCU_H
5 * Copyright (c) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
8 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
10 * Permission is hereby granted to use or copy this program
11 * for any purpose, provided the above notices are retained on all copies.
12 * Permission to modify the code and to distribute modified code is granted,
13 * provided the above notices are retained, and a notice that the code was
14 * modified is included with the above copyright notice.
16 * This file allows weak linking on tracepoint RCU symbols for non-LGPL
20 #include <urcu/compiler.h>
26 #define TP_RCU_LINK_TEST() 1
27 #define tp_rcu_read_lock_bp rcu_read_lock_bp
28 #define tp_rcu_read_unlock_bp rcu_read_unlock_bp
29 #define tp_rcu_dereference_bp rcu_dereference_bp
31 #else /* _LGPL_SOURCE */
33 #define TP_RCU_LINK_TEST() tp_rcu_read_lock_bp
35 /* Symbols looked up with dlsym */
36 static void (*tp_rcu_read_lock_bp
)(void) __attribute__((unused
));
37 static void (*tp_rcu_read_unlock_bp
)(void) __attribute__((unused
));
38 static void *(*tp_rcu_dereference_sym_bp
)(void *p
) __attribute__((unused
));
40 #define tp_rcu_dereference_bp(p) \
42 typeof(p) _________p1 = URCU_FORCE_CAST(typeof(p), \
43 tp_rcu_dereference_sym_bp(URCU_FORCE_CAST(void *, p))); \
47 #endif /* _LGPL_SOURCE */
49 #endif /* _LTTNG_TRACEPOINT_RCU_H */