1*86d7f5d3SJohn Marino /* 2*86d7f5d3SJohn Marino * Copyright (c) 2004 David Xu <davidxu@freebsd.org> 3*86d7f5d3SJohn Marino * All rights reserved. 4*86d7f5d3SJohn Marino * 5*86d7f5d3SJohn Marino * Redistribution and use in source and binary forms, with or without 6*86d7f5d3SJohn Marino * modification, are permitted provided that the following conditions 7*86d7f5d3SJohn Marino * are met: 8*86d7f5d3SJohn Marino * 1. Redistributions of source code must retain the above copyright 9*86d7f5d3SJohn Marino * notice, this list of conditions and the following disclaimer. 10*86d7f5d3SJohn Marino * 2. Redistributions in binary form must reproduce the above copyright 11*86d7f5d3SJohn Marino * notice, this list of conditions and the following disclaimer in the 12*86d7f5d3SJohn Marino * documentation and/or other materials provided with the distribution. 13*86d7f5d3SJohn Marino * 14*86d7f5d3SJohn Marino * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15*86d7f5d3SJohn Marino * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16*86d7f5d3SJohn Marino * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17*86d7f5d3SJohn Marino * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18*86d7f5d3SJohn Marino * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19*86d7f5d3SJohn Marino * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20*86d7f5d3SJohn Marino * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21*86d7f5d3SJohn Marino * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22*86d7f5d3SJohn Marino * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23*86d7f5d3SJohn Marino * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24*86d7f5d3SJohn Marino * SUCH DAMAGE. 25*86d7f5d3SJohn Marino * 26*86d7f5d3SJohn Marino * $DragonFly: src/lib/libthread_db/thread_db_int.h,v 1.1 2005/05/07 09:25:44 davidxu Exp $ 27*86d7f5d3SJohn Marino */ 28*86d7f5d3SJohn Marino 29*86d7f5d3SJohn Marino #ifndef _THREAD_DB_INT_H_ 30*86d7f5d3SJohn Marino #define _THREAD_DB_INT_H_ 31*86d7f5d3SJohn Marino 32*86d7f5d3SJohn Marino #include <sys/types.h> 33*86d7f5d3SJohn Marino #include <sys/queue.h> 34*86d7f5d3SJohn Marino 35*86d7f5d3SJohn Marino #define TD_THRAGENT_FIELDS \ 36*86d7f5d3SJohn Marino struct ta_ops *ta_ops; \ 37*86d7f5d3SJohn Marino TAILQ_ENTRY(td_thragent) ta_next; \ 38*86d7f5d3SJohn Marino struct ps_prochandle *ph 39*86d7f5d3SJohn Marino 40*86d7f5d3SJohn Marino struct ta_ops { 41*86d7f5d3SJohn Marino td_err_e (*to_init)(void); 42*86d7f5d3SJohn Marino 43*86d7f5d3SJohn Marino td_err_e (*to_ta_clear_event)(const td_thragent_t *, 44*86d7f5d3SJohn Marino td_thr_events_t *); 45*86d7f5d3SJohn Marino td_err_e (*to_ta_delete)(td_thragent_t *); 46*86d7f5d3SJohn Marino td_err_e (*to_ta_event_addr)(const td_thragent_t *, td_thr_events_e, 47*86d7f5d3SJohn Marino td_notify_t *); 48*86d7f5d3SJohn Marino td_err_e (*to_ta_event_getmsg)(const td_thragent_t *, 49*86d7f5d3SJohn Marino td_event_msg_t *); 50*86d7f5d3SJohn Marino td_err_e (*to_ta_map_id2thr)(const td_thragent_t *, thread_t, 51*86d7f5d3SJohn Marino td_thrhandle_t *); 52*86d7f5d3SJohn Marino td_err_e (*to_ta_map_lwp2thr)(const td_thragent_t *, lwpid_t, 53*86d7f5d3SJohn Marino td_thrhandle_t *); 54*86d7f5d3SJohn Marino td_err_e (*to_ta_new)(struct ps_prochandle *, td_thragent_t **); 55*86d7f5d3SJohn Marino td_err_e (*to_ta_set_event)(const td_thragent_t *, td_thr_events_t *); 56*86d7f5d3SJohn Marino td_err_e (*to_ta_thr_iter)(const td_thragent_t *, td_thr_iter_f *, 57*86d7f5d3SJohn Marino void *, td_thr_state_e, int, sigset_t *, unsigned int); 58*86d7f5d3SJohn Marino td_err_e (*to_ta_tsd_iter)(const td_thragent_t *, td_key_iter_f *, 59*86d7f5d3SJohn Marino void *); 60*86d7f5d3SJohn Marino 61*86d7f5d3SJohn Marino td_err_e (*to_thr_clear_event)(const td_thrhandle_t *, 62*86d7f5d3SJohn Marino td_thr_events_t *); 63*86d7f5d3SJohn Marino td_err_e (*to_thr_dbresume)(const td_thrhandle_t *); 64*86d7f5d3SJohn Marino td_err_e (*to_thr_dbsuspend)(const td_thrhandle_t *); 65*86d7f5d3SJohn Marino td_err_e (*to_thr_event_enable)(const td_thrhandle_t *, int); 66*86d7f5d3SJohn Marino td_err_e (*to_thr_event_getmsg)(const td_thrhandle_t *, 67*86d7f5d3SJohn Marino td_event_msg_t *); 68*86d7f5d3SJohn Marino td_err_e (*to_thr_get_info)(const td_thrhandle_t *, td_thrinfo_t *); 69*86d7f5d3SJohn Marino td_err_e (*to_thr_getfpregs)(const td_thrhandle_t *, prfpregset_t *); 70*86d7f5d3SJohn Marino td_err_e (*to_thr_getgregs)(const td_thrhandle_t *, prgregset_t); 71*86d7f5d3SJohn Marino td_err_e (*to_thr_set_event)(const td_thrhandle_t *, 72*86d7f5d3SJohn Marino td_thr_events_t *); 73*86d7f5d3SJohn Marino td_err_e (*to_thr_setfpregs)(const td_thrhandle_t *, 74*86d7f5d3SJohn Marino const prfpregset_t *); 75*86d7f5d3SJohn Marino td_err_e (*to_thr_setgregs)(const td_thrhandle_t *, const prgregset_t); 76*86d7f5d3SJohn Marino td_err_e (*to_thr_validate)(const td_thrhandle_t *); 77*86d7f5d3SJohn Marino td_err_e (*to_thr_tls_get_addr)(const td_thrhandle_t *, 78*86d7f5d3SJohn Marino void *, size_t, void **); 79*86d7f5d3SJohn Marino }; 80*86d7f5d3SJohn Marino 81*86d7f5d3SJohn Marino #ifdef TD_DEBUG 82*86d7f5d3SJohn Marino #define TDBG(...) ps_plog(__VA_ARGS__) 83*86d7f5d3SJohn Marino #define TDBG_FUNC() ps_plog("%s\n", __func__) 84*86d7f5d3SJohn Marino #else 85*86d7f5d3SJohn Marino #define TDBG(...) 86*86d7f5d3SJohn Marino #define TDBG_FUNC() 87*86d7f5d3SJohn Marino #endif 88*86d7f5d3SJohn Marino 89*86d7f5d3SJohn Marino #endif /* _THREAD_DB_INT_H_ */ 90