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