include: implement REUSE with SPDX identifiers
[lttng-ust.git] / include / lttng / tracepoint-rcu.h
CommitLineData
1c196845
MJ
1// SPDX-FileCopyrightText: 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2//
3// SPDX-License-Identifier: MIT
40b2b5a4 4
9b14815a
MD
5#ifndef _LTTNG_UST_TRACEPOINT_RCU_H
6#define _LTTNG_UST_TRACEPOINT_RCU_H
c0c0989a 7
40b2b5a4 8#include <urcu/compiler.h>
10544ee8 9#include <lttng/urcu/pointer.h>
251c9f75 10#include <lttng/ust-api-compat.h>
40b2b5a4
MD
11
12#ifdef _LGPL_SOURCE
13
10544ee8 14#include <lttng/urcu/urcu-ust.h>
40b2b5a4 15
251c9f75
MJ
16#define lttng_ust_tp_rcu_read_lock lttng_ust_urcu_read_lock
17#define lttng_ust_tp_rcu_read_unlock lttng_ust_urcu_read_unlock
18#define lttng_ust_tp_rcu_dereference lttng_ust_rcu_dereference
19#define LTTNG_UST_TP_RCU_LINK_TEST() 1
40b2b5a4
MD
20
21#else /* _LGPL_SOURCE */
22
251c9f75
MJ
23#define lttng_ust_tp_rcu_read_lock lttng_ust_tracepoint_dlopen_ptr->rcu_read_lock_sym
24#define lttng_ust_tp_rcu_read_unlock lttng_ust_tracepoint_dlopen_ptr->rcu_read_unlock_sym
40b2b5a4 25
251c9f75 26#define lttng_ust_tp_rcu_dereference(p) \
4d3b06fe 27 URCU_FORCE_CAST(__typeof__(p), \
7863d51a 28 lttng_ust_tracepoint_dlopen_ptr->rcu_dereference_sym(URCU_FORCE_CAST(void *, p)))
40b2b5a4 29
4405cc3e 30#define LTTNG_UST_TP_RCU_LINK_TEST() (lttng_ust_tracepoint_dlopen_ptr && lttng_ust_tp_rcu_read_lock)
51920067 31
40b2b5a4
MD
32#endif /* _LGPL_SOURCE */
33
251c9f75
MJ
34#if LTTNG_UST_COMPAT_API(0)
35#define tp_rcu_read_lock lttng_ust_tp_rcu_read_lock
36#define tp_rcu_read_unlock lttng_ust_tp_rcu_read_unlock
37#define tp_rcu_dereference lttng_ust_tp_rcu_dereference
38#define TP_RCU_LINK_TEST LTTNG_UST_TP_RCU_LINK_TEST
39#endif
40
9b14815a 41#endif /* _LTTNG_UST_TRACEPOINT_RCU_H */
This page took 0.035684 seconds and 4 git commands to generate.