xref: /titanic_44/usr/src/cmd/ptools/pmap/pmap_common.h (revision 186f7fbf5e07d046b50e4e15c32b21f109b76c80)
1*186f7fbfSEdward Pilatowicz /*
2*186f7fbfSEdward Pilatowicz  * CDDL HEADER START
3*186f7fbfSEdward Pilatowicz  *
4*186f7fbfSEdward Pilatowicz  * The contents of this file are subject to the terms of the
5*186f7fbfSEdward Pilatowicz  * Common Development and Distribution License (the "License").
6*186f7fbfSEdward Pilatowicz  * You may not use this file except in compliance with the License.
7*186f7fbfSEdward Pilatowicz  *
8*186f7fbfSEdward Pilatowicz  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*186f7fbfSEdward Pilatowicz  * or http://www.opensolaris.org/os/licensing.
10*186f7fbfSEdward Pilatowicz  * See the License for the specific language governing permissions
11*186f7fbfSEdward Pilatowicz  * and limitations under the License.
12*186f7fbfSEdward Pilatowicz  *
13*186f7fbfSEdward Pilatowicz  * When distributing Covered Code, include this CDDL HEADER in each
14*186f7fbfSEdward Pilatowicz  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*186f7fbfSEdward Pilatowicz  * If applicable, add the following below this CDDL HEADER, with the
16*186f7fbfSEdward Pilatowicz  * fields enclosed by brackets "[]" replaced with your own identifying
17*186f7fbfSEdward Pilatowicz  * information: Portions Copyright [yyyy] [name of copyright owner]
18*186f7fbfSEdward Pilatowicz  *
19*186f7fbfSEdward Pilatowicz  * CDDL HEADER END
20*186f7fbfSEdward Pilatowicz  */
21*186f7fbfSEdward Pilatowicz 
22*186f7fbfSEdward Pilatowicz /*
23*186f7fbfSEdward Pilatowicz  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24*186f7fbfSEdward Pilatowicz  * Use is subject to license terms.
25*186f7fbfSEdward Pilatowicz  */
26*186f7fbfSEdward Pilatowicz 
27*186f7fbfSEdward Pilatowicz #ifndef	_PMAP_COMMON_H
28*186f7fbfSEdward Pilatowicz #define	_PMAP_COMMON_H
29*186f7fbfSEdward Pilatowicz 
30*186f7fbfSEdward Pilatowicz #ifdef	__cplusplus
31*186f7fbfSEdward Pilatowicz extern "C" {
32*186f7fbfSEdward Pilatowicz #endif
33*186f7fbfSEdward Pilatowicz 
34*186f7fbfSEdward Pilatowicz typedef struct lwpstack {
35*186f7fbfSEdward Pilatowicz 	lwpid_t	lwps_lwpid;
36*186f7fbfSEdward Pilatowicz 	stack_t	lwps_stack;
37*186f7fbfSEdward Pilatowicz } lwpstack_t;
38*186f7fbfSEdward Pilatowicz 
39*186f7fbfSEdward Pilatowicz /*
40*186f7fbfSEdward Pilatowicz  * Used to set the advice type var (at_map) when parsing the arguments to
41*186f7fbfSEdward Pilatowicz  * pmadvise.  Later, when creating the map list, at_map is used as a mask
42*186f7fbfSEdward Pilatowicz  * to determine if any generic advice applies to each memory mapping.
43*186f7fbfSEdward Pilatowicz  */
44*186f7fbfSEdward Pilatowicz enum	atype_enum {
45*186f7fbfSEdward Pilatowicz 	AT_PRIVM,
46*186f7fbfSEdward Pilatowicz 	AT_SHARED,
47*186f7fbfSEdward Pilatowicz 	AT_HEAP,
48*186f7fbfSEdward Pilatowicz 	AT_STACK,
49*186f7fbfSEdward Pilatowicz 	AT_SEG,
50*186f7fbfSEdward Pilatowicz 	AT_NTYPES
51*186f7fbfSEdward Pilatowicz };
52*186f7fbfSEdward Pilatowicz 
53*186f7fbfSEdward Pilatowicz extern int cmpstacks(const void *, const void *);
54*186f7fbfSEdward Pilatowicz extern char *make_name(struct ps_prochandle *, int, uintptr_t,
55*186f7fbfSEdward Pilatowicz     const char *, char *, size_t);
56*186f7fbfSEdward Pilatowicz extern char *anon_name(char *, const pstatus_t *, lwpstack_t *, uint_t,
57*186f7fbfSEdward Pilatowicz     uintptr_t, size_t, int, int, int *);
58*186f7fbfSEdward Pilatowicz 
59*186f7fbfSEdward Pilatowicz 
60*186f7fbfSEdward Pilatowicz #ifdef	__cplusplus
61*186f7fbfSEdward Pilatowicz }
62*186f7fbfSEdward Pilatowicz #endif
63*186f7fbfSEdward Pilatowicz 
64*186f7fbfSEdward Pilatowicz #endif	/* _PMAP_COMMON_H */
65