xref: /dflybsd-src/lib/libthread_xu/thread/thr_symbols.c (revision 71b3fa151e714295cd932238bb91973cd4a02c55)
1*71b3fa15SDavid Xu /*
2*71b3fa15SDavid Xu  * Copyright (c) 2004 David Xu <davidxu@freebsd.org>
3*71b3fa15SDavid Xu  * All rights reserved.
4*71b3fa15SDavid Xu  *
5*71b3fa15SDavid Xu  * Redistribution and use in source and binary forms, with or without
6*71b3fa15SDavid Xu  * modification, are permitted provided that the following conditions
7*71b3fa15SDavid Xu  * are met:
8*71b3fa15SDavid Xu  * 1. Redistributions of source code must retain the above copyright
9*71b3fa15SDavid Xu  *    notice, this list of conditions and the following disclaimer.
10*71b3fa15SDavid Xu  * 2. Redistributions in binary form must reproduce the above copyright
11*71b3fa15SDavid Xu  *    notice, this list of conditions and the following disclaimer in the
12*71b3fa15SDavid Xu  *    documentation and/or other materials provided with the distribution.
13*71b3fa15SDavid Xu  * 3. All advertising materials mentioning features or use of this software
14*71b3fa15SDavid Xu  *    must display the following acknowledgement:
15*71b3fa15SDavid Xu  *	This product includes software developed by John Birrell.
16*71b3fa15SDavid Xu  * 4. Neither the name of the author nor the names of any co-contributors
17*71b3fa15SDavid Xu  *    may be used to endorse or promote products derived from this software
18*71b3fa15SDavid Xu  *    without specific prior written permission.
19*71b3fa15SDavid Xu  *
20*71b3fa15SDavid Xu  * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
21*71b3fa15SDavid Xu  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22*71b3fa15SDavid Xu  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23*71b3fa15SDavid Xu  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24*71b3fa15SDavid Xu  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25*71b3fa15SDavid Xu  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26*71b3fa15SDavid Xu  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27*71b3fa15SDavid Xu  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28*71b3fa15SDavid Xu  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29*71b3fa15SDavid Xu  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30*71b3fa15SDavid Xu  * SUCH DAMAGE.
31*71b3fa15SDavid Xu  *
32*71b3fa15SDavid Xu  * $FreeBSD: src/lib/libpthread/thread/thr_symbols.c,v 1.1 2004/08/16 03:25:07 davidxu Exp $
33*71b3fa15SDavid Xu  * $DragonFly: src/lib/libthread_xu/thread/thr_symbols.c,v 1.1 2005/02/01 12:38:27 davidxu Exp $
34*71b3fa15SDavid Xu  */
35*71b3fa15SDavid Xu 
36*71b3fa15SDavid Xu #include <stddef.h>
37*71b3fa15SDavid Xu #include <pthread.h>
38*71b3fa15SDavid Xu #ifndef __DragonFly__
39*71b3fa15SDavid Xu #include <rtld.h>
40*71b3fa15SDavid Xu #endif
41*71b3fa15SDavid Xu 
42*71b3fa15SDavid Xu #include "thr_private.h"
43*71b3fa15SDavid Xu 
44*71b3fa15SDavid Xu /* A collection of symbols needed by debugger */
45*71b3fa15SDavid Xu 
46*71b3fa15SDavid Xu int _thread_off_tcb = offsetof(struct pthread, tcb);
47*71b3fa15SDavid Xu int _thread_off_tid = offsetof(struct pthread, tid);
48*71b3fa15SDavid Xu int _thread_off_next = offsetof(struct pthread, tle.tqe_next);
49*71b3fa15SDavid Xu int _thread_off_attr_flags = offsetof(struct pthread, attr.flags);
50*71b3fa15SDavid Xu int _thread_off_thr_locklevel = offsetof(struct pthread, locklevel);
51*71b3fa15SDavid Xu int _thread_off_isdead = offsetof(struct pthread, terminated);
52*71b3fa15SDavid Xu int _thread_size_key = sizeof(struct pthread_key);
53*71b3fa15SDavid Xu int _thread_off_key_allocated = offsetof(struct pthread_key, allocated);
54*71b3fa15SDavid Xu int _thread_off_key_destructor = offsetof(struct pthread_key, destructor);
55*71b3fa15SDavid Xu int _thread_max_keys = PTHREAD_KEYS_MAX;
56*71b3fa15SDavid Xu int _thread_off_dtv = DTV_OFFSET;
57*71b3fa15SDavid Xu int _thread_off_state = offsetof(struct pthread, state);
58*71b3fa15SDavid Xu int _thread_state_running = PS_RUNNING;
59*71b3fa15SDavid Xu int _thread_state_zoombie = PS_DEAD;
60*71b3fa15SDavid Xu #ifndef __DragonFly__
61*71b3fa15SDavid Xu int _thread_off_linkmap = offsetof(Obj_Entry, linkmap);
62*71b3fa15SDavid Xu int _thread_off_tlsindex = offsetof(Obj_Entry, tlsindex);
63*71b3fa15SDavid Xu #endif
64