xref: /illumos-gate/usr/src/cmd/sgs/link_audit/common/who.h (revision aa693e996c2928c92cccd8a3efe91373e85a6967)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
24  */
25 #ifndef WHO_DOT_H
26 #define	WHO_DOT_H
27 
28 #include <link.h>
29 #include <sys/regset.h>
30 #include <sys/frame.h>
31 #include <sys/elf.h>
32 
33 #if defined(__sparcv9)
34 #define	Elf_Ehdr	Elf64_Ehdr
35 #define	Elf_Phdr	Elf64_Phdr
36 #define	Elf_Shdr	Elf64_Shdr
37 #define	Elf_Sym		Elf64_Sym
38 #define	elf_getshdr	elf64_getshdr
39 #else
40 #define	Elf_Ehdr	Elf32_Ehdr
41 #define	Elf_Phdr	Elf32_Phdr
42 #define	Elf_Shdr	Elf32_Shdr
43 #define	Elf_Sym		Elf32_Sym
44 #define	elf_getshdr	elf32_getshdr
45 #endif
46 
47 
48 typedef struct objinfo {
49 	caddr_t			o_lpc;		/* low PC */
50 	caddr_t			o_hpc;		/* high PC */
51 	int			o_fd;		/* file descriptor */
52 	Elf 			*o_elf;		/* Elf pointer */
53 	Elf_Sym 		*o_syms;	/* symbol table */
54 	uint_t			o_symcnt;	/* # of symbols */
55 	const char 		*o_strs;	/* symbol string  table */
56 	Link_map 		*o_lmp;
57 	uint_t			o_flags;
58 	struct objinfo 		*o_next;
59 } Objinfo;
60 
61 #define	FLG_OB_NOSYMS	0x0001		/* no symbols available for obj */
62 #define	FLG_OB_FIXED	0x0002		/* fixed address object */
63 
64 
65 #if defined(__sparc)
66 #if defined(__GNUC__)
67 #define	FLUSHWIN() __asm__("ta 3");
68 #else	/* !__GNUC__ */
69 #define	FLUSHWIN() asm("ta 3");
70 #endif
71 #endif
72 
73 #if defined(__x86)
74 #define	FLUSHWIN()
75 #endif
76 
77 #ifndef	STACK_BIAS
78 #define	STACK_BIAS	0
79 #endif
80 
81 #endif /* WHO_DOT_H */
82