include: implement REUSE with SPDX identifiers
[lttng-ust.git] / include / lttng / tracepoint-rcu.h
... / ...
CommitLineData
1// SPDX-FileCopyrightText: 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2//
3// SPDX-License-Identifier: MIT
4
5#ifndef _LTTNG_UST_TRACEPOINT_RCU_H
6#define _LTTNG_UST_TRACEPOINT_RCU_H
7
8#include <urcu/compiler.h>
9#include <lttng/urcu/pointer.h>
10#include <lttng/ust-api-compat.h>
11
12#ifdef _LGPL_SOURCE
13
14#include <lttng/urcu/urcu-ust.h>
15
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
20
21#else /* _LGPL_SOURCE */
22
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
25
26#define lttng_ust_tp_rcu_dereference(p) \
27 URCU_FORCE_CAST(__typeof__(p), \
28 lttng_ust_tracepoint_dlopen_ptr->rcu_dereference_sym(URCU_FORCE_CAST(void *, p)))
29
30#define LTTNG_UST_TP_RCU_LINK_TEST() (lttng_ust_tracepoint_dlopen_ptr && lttng_ust_tp_rcu_read_lock)
31
32#endif /* _LGPL_SOURCE */
33
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
41#endif /* _LTTNG_UST_TRACEPOINT_RCU_H */
This page took 0.022551 seconds and 4 git commands to generate.