xref: /freebsd/lib/libthr/thread/thr_symbols.c (revision a2f733abcff64628b7771a47089628b7327a88bd)
18a16b7a1SPedro F. Giffuni /*-
28a16b7a1SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
38a16b7a1SPedro F. Giffuni  *
4a091d823SDavid Xu  * Copyright (c) 2004 David Xu <davidxu@freebsd.org>
5a091d823SDavid Xu  * All rights reserved.
6a091d823SDavid Xu  *
7a091d823SDavid Xu  * Redistribution and use in source and binary forms, with or without
8a091d823SDavid Xu  * modification, are permitted provided that the following conditions
9a091d823SDavid Xu  * are met:
10a091d823SDavid Xu  * 1. Redistributions of source code must retain the above copyright
11a091d823SDavid Xu  *    notice, this list of conditions and the following disclaimer.
12a091d823SDavid Xu  * 2. Redistributions in binary form must reproduce the above copyright
13a091d823SDavid Xu  *    notice, this list of conditions and the following disclaimer in the
14a091d823SDavid Xu  *    documentation and/or other materials provided with the distribution.
15fed32d75SWarner Losh  * 3. Neither the name of the author nor the names of any co-contributors
16a091d823SDavid Xu  *    may be used to endorse or promote products derived from this software
17a091d823SDavid Xu  *    without specific prior written permission.
18a091d823SDavid Xu  *
19a091d823SDavid Xu  * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
20a091d823SDavid Xu  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21a091d823SDavid Xu  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22a091d823SDavid Xu  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23a091d823SDavid Xu  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24a091d823SDavid Xu  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25a091d823SDavid Xu  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26a091d823SDavid Xu  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27a091d823SDavid Xu  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28a091d823SDavid Xu  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29a091d823SDavid Xu  * SUCH DAMAGE.
30a091d823SDavid Xu  */
31a091d823SDavid Xu 
327e4cbc3aSStefan Farfeleder #include <sys/types.h>
33a091d823SDavid Xu #include <stddef.h>
34a091d823SDavid Xu #include <pthread.h>
35a091d823SDavid Xu #include <rtld.h>
36a091d823SDavid Xu 
37a091d823SDavid Xu #include "thr_private.h"
38a091d823SDavid Xu 
39a091d823SDavid Xu /* A collection of symbols needed by debugger */
40a091d823SDavid Xu 
41a091d823SDavid Xu /* int _libthr_debug */
42a091d823SDavid Xu int _thread_off_tcb = offsetof(struct pthread, tcb);
43a091d823SDavid Xu int _thread_off_tid = offsetof(struct pthread, tid);
44a091d823SDavid Xu int _thread_off_next = offsetof(struct pthread, tle.tqe_next);
45a091d823SDavid Xu int _thread_off_attr_flags = offsetof(struct pthread, attr.flags);
46a091d823SDavid Xu int _thread_off_linkmap = offsetof(Obj_Entry, linkmap);
47a091d823SDavid Xu int _thread_off_tlsindex = offsetof(Obj_Entry, tlsindex);
48d245d9e1SDavid Xu int _thread_off_report_events = offsetof(struct pthread, report_events);
49d245d9e1SDavid Xu int _thread_off_event_mask = offsetof(struct pthread, event_mask);
50d245d9e1SDavid Xu int _thread_off_event_buf = offsetof(struct pthread, event_buf);
51a091d823SDavid Xu int _thread_size_key = sizeof(struct pthread_key);
52a091d823SDavid Xu int _thread_off_key_allocated = offsetof(struct pthread_key, allocated);
53a091d823SDavid Xu int _thread_off_key_destructor = offsetof(struct pthread_key, destructor);
54a091d823SDavid Xu int _thread_max_keys = PTHREAD_KEYS_MAX;
55*5d817633SJohn Baldwin int _thread_off_dtv = offsetof(struct tcb, tcb_dtv);
56a091d823SDavid Xu int _thread_off_state = offsetof(struct pthread, state);
57a091d823SDavid Xu int _thread_state_running = PS_RUNNING;
58a091d823SDavid Xu int _thread_state_zoombie = PS_DEAD;
59