xref: /minix3/sys/sys/kern_ctf.h (revision 6c8f7fc3bac7ab5f78ee27de8bed706631d8c836)
1*6c8f7fc3SBen Gras /*	$NetBSD: kern_ctf.h,v 1.1 2010/03/12 21:43:10 darran Exp $	*/
2*6c8f7fc3SBen Gras 
3*6c8f7fc3SBen Gras /*-
4*6c8f7fc3SBen Gras  * Copyright (c) 2010 The NetBSD Foundation, Inc.
5*6c8f7fc3SBen Gras  * All rights reserved.
6*6c8f7fc3SBen Gras  *
7*6c8f7fc3SBen Gras  * Redistribution and use in source and binary forms, with or without
8*6c8f7fc3SBen Gras  * modification, are permitted provided that the following conditions
9*6c8f7fc3SBen Gras  * are met:
10*6c8f7fc3SBen Gras  * 1. Redistributions of source code must retain the above copyright
11*6c8f7fc3SBen Gras  *    notice, this list of conditions and the following disclaimer.
12*6c8f7fc3SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
13*6c8f7fc3SBen Gras  *    notice, this list of conditions and the following disclaimer in the
14*6c8f7fc3SBen Gras  *    documentation and/or other materials provided with the distribution.
15*6c8f7fc3SBen Gras  *
16*6c8f7fc3SBen Gras  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17*6c8f7fc3SBen Gras  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18*6c8f7fc3SBen Gras  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19*6c8f7fc3SBen Gras  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20*6c8f7fc3SBen Gras  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21*6c8f7fc3SBen Gras  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22*6c8f7fc3SBen Gras  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23*6c8f7fc3SBen Gras  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24*6c8f7fc3SBen Gras  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25*6c8f7fc3SBen Gras  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26*6c8f7fc3SBen Gras  * POSSIBILITY OF SUCH DAMAGE.
27*6c8f7fc3SBen Gras  */
28*6c8f7fc3SBen Gras 
29*6c8f7fc3SBen Gras #ifndef _SYS_CTF_H_
30*6c8f7fc3SBen Gras #define	_SYS_CTF_H_
31*6c8f7fc3SBen Gras 
32*6c8f7fc3SBen Gras /*
33*6c8f7fc3SBen Gras  * Modules CTF section
34*6c8f7fc3SBen Gras  */
35*6c8f7fc3SBen Gras typedef struct mod_ctf {
36*6c8f7fc3SBen Gras 	const uint8_t 	*ctftab;	/* Decompressed CTF data. */
37*6c8f7fc3SBen Gras 	int 		ctfcnt;		/* Number of CTF data bytes. */
38*6c8f7fc3SBen Gras 	const Elf_Sym	*symtab;	/* Ptr to the symbol table. */
39*6c8f7fc3SBen Gras 	int		nsym;		/* Number of symbols. */
40*6c8f7fc3SBen Gras 	uint32_t	*nmap;		/* symbol id map */
41*6c8f7fc3SBen Gras 	int		nmapsize;	/* Span of id map */
42*6c8f7fc3SBen Gras 	const char	*strtab;	/* Ptr to the string table. */
43*6c8f7fc3SBen Gras 	int 		strcnt;		/* Number of string bytes. */
44*6c8f7fc3SBen Gras 	uint32_t	*ctfoffp;	/* Ptr to array of obj/fnc offsets. */
45*6c8f7fc3SBen Gras 	uint32_t	*typoffp;	/* Ptr to array of type offsets. */
46*6c8f7fc3SBen Gras 	long		typlen;		/* number of type data entries. */
47*6c8f7fc3SBen Gras 	int		ctfalloc;	/* ctftab is alloced */
48*6c8f7fc3SBen Gras } mod_ctf_t;
49*6c8f7fc3SBen Gras 
50*6c8f7fc3SBen Gras int
51*6c8f7fc3SBen Gras mod_ctf_get(struct module *, mod_ctf_t *);
52*6c8f7fc3SBen Gras 
53*6c8f7fc3SBen Gras #endif
54