2 * Copyright (C) 2020 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License only.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 #ifndef _LTTNG_UST_SIGBUS_H
19 #define _LTTNG_UST_SIGBUS_H
21 #include <urcu/list.h>
24 struct lttng_ust_sigbus_range
{
25 void *start
; /* inclusive */
26 void *end
; /* exclusive */
27 struct cds_list_head node
;
30 struct lttng_ust_sigbus_state
{
32 struct cds_list_head head
; /* struct lttng_ust_sigbus_range */
37 * Define the lttng_ust_sigbus_state TLS variable as initial-exec model
38 * to allow using it from the SIGBUS signal handler. This variable must
39 * be defined by the executable using DEFINE_LTTNG_UST_SIGBUS_STATE()
40 * rather than internally within liblttng-ust-ctl.so to ensure we don't
41 * contribute to reach glibc limits of pre-allocated TLS IE model space
44 #define DEFINE_LTTNG_UST_SIGBUS_STATE() \
45 __thread __attribute__((tls_model("initial-exec"))) struct lttng_ust_sigbus_state lttng_ust_sigbus_state
47 extern __thread
__attribute__((tls_model("initial-exec"))) struct lttng_ust_sigbus_state lttng_ust_sigbus_state
;
49 #endif /* _LTTNG_UST_SIGBUS_H */