xref: /illumos-gate/usr/src/cmd/mdb/common/modules/genunix/memory.h (revision 45ede40b2394db7967e59f19288fae9b62efd4aa)
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  * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 
25 #ifndef	_MEMORY_H
26 #define	_MEMORY_H
27 
28 #ifdef	__cplusplus
29 extern "C" {
30 #endif
31 
32 int page_walk_init(mdb_walk_state_t *);
33 int page_walk_step(mdb_walk_state_t *);
34 void page_walk_fini(mdb_walk_state_t *);
35 int page(uintptr_t, uint_t, int, const mdb_arg_t *);
36 int allpages_walk_init(mdb_walk_state_t *);
37 int allpages_walk_step(mdb_walk_state_t *);
38 void allpages_walk_fini(mdb_walk_state_t *);
39 int memstat(uintptr_t, uint_t, int, const mdb_arg_t *);
40 
41 int pagelookup(uintptr_t, uint_t, int, const mdb_arg_t *);
42 void pagelookup_help(void);
43 int page_num2pp(uintptr_t, uint_t, int, const mdb_arg_t *);
44 
45 int seg_walk_init(mdb_walk_state_t *);
46 int seg(uintptr_t, uint_t, int, const mdb_arg_t *);
47 
48 #define	SEGVN_PAGES_RESIDENT	(void *)(uintptr_t)0
49 #define	SEGVN_PAGES_ALL		(void *)(uintptr_t)1
50 int segvn_pages_walk_init(mdb_walk_state_t *);
51 int segvn_pages_walk_step(mdb_walk_state_t *);
52 void segvn_pages_walk_fini(mdb_walk_state_t *);
53 
54 int vnode2smap(uintptr_t, uint_t, int, const mdb_arg_t *);
55 int addr2smap(uintptr_t, uint_t, int, const mdb_arg_t *);
56 
57 #define	ANON_WALK_ALLOC	(void *)(uintptr_t)0
58 #define	ANON_WALK_ALL	(void *)(uintptr_t)1
59 int anon_walk_init(mdb_walk_state_t *);
60 int segvn_anon_walk_init(mdb_walk_state_t *);
61 int anon_walk_step(mdb_walk_state_t *);
62 void anon_walk_fini(mdb_walk_state_t *);
63 int pmap(uintptr_t, uint_t, int, const mdb_arg_t *);
64 
65 int swap_walk_init(mdb_walk_state_t *);
66 int swap_walk_step(mdb_walk_state_t *);
67 int swapinfof(uintptr_t, uint_t, int, const mdb_arg_t *);
68 
69 int memlist_walk_step(mdb_walk_state_t *);
70 int memlist(uintptr_t, uint_t, int, const mdb_arg_t *);
71 
72 #ifdef	__cplusplus
73 }
74 #endif
75 
76 #endif	/* _MEMORY_H */
77