1 /*
2  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
3  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
4  */
5 
6 /*
7  * This file is used to limit the symbols that are to be exported from the
8  * debugger.  This ensures that dmods follow the module API.
9  *
10  * There is a special rule for generating the mapfile. If the symbol
11  * is not a function then the symbol, in the mapfile, must have the
12  * the token "variable" as the third symbol on the line - see the
13  * entries for __ctype and errno below.
14  */
15 
16 $mapfile_version 2
17 
18 SYMBOL_SCOPE {
19 	global:
20 
21 		/*
22 		 * Exported functions and variables from:
23 		 *  ../../../common/kmdb/kmdb_dpi.h
24 		 */
25 		kmdb_dpi_work_required;
26 		kmdb_dpi_resume_requested; /* variable */
27 		kmdb_dpi_switch_target; /* variable */
28 
29 		/*
30 		 * Exported functions and variables from:
31 		 *  ../../../common/kmdb/kmdb_kctl.h
32 		 */
33 		kmdb_init;
34 		kmdb_init_promif;
35 		kmdb_activate;
36 		kmdb_deactivate;
37 
38 		/*
39 		 * Exported functions and variables from:
40 		 *  ../../../common/kmdb/kmdb_kdi.h
41 		 */
42 		kmdb_kdi_kmdb_enter;
43 		kmdb_kdi_get_unload_request;
44 		kmdb_kdi_set_unload_request;
45 		kmdb_kdi_get_flags;
46 
47 		/*
48 		 * Exported functions and variables from:
49 		 *  ../../../common/kmdb/kmdb_wr.h
50 		 */
51 		kmdb_wr_debugger_notify;
52 		kmdb_wr_debugger_process;
53 		kmdb_wr_debugger_notify_isempty;
54 		kmdb_wr_driver_notify;
55 		kmdb_wr_driver_process;
56 		kmdb_wr_driver_notify_isempty;
57 
58 		/*
59 		 * Exported functions and variables from:
60 		 *  ../../../common/mdb/mdb_ctf.h
61 		 */
62 		mdb_ctf_enabled_by_object;
63 		mdb_ctf_lookup_by_name;
64 		mdb_ctf_lookup_by_addr;
65 		mdb_ctf_module_lookup;
66 		mdb_ctf_func_info;
67 		mdb_ctf_func_args;
68 		mdb_ctf_type_invalidate;
69 		mdb_ctf_type_valid;
70 		mdb_ctf_type_cmp;
71 		mdb_ctf_type_resolve;
72 		mdb_ctf_type_name;
73 		mdb_ctf_type_size;
74 		mdb_ctf_type_kind;
75 		mdb_ctf_type_reference;
76 		mdb_ctf_type_encoding;
77 		mdb_ctf_type_visit;
78 		mdb_ctf_array_info;
79 		mdb_ctf_enum_name;
80 		mdb_ctf_member_iter;
81 		mdb_ctf_enum_iter;
82 		mdb_ctf_type_iter;
83 		mdb_ctf_type_delete;
84 		mdb_ctf_synthetics_create_base;
85 		mdb_ctf_synthetics_reset;
86 		mdb_ctf_add_typedef;
87 		mdb_ctf_add_struct;
88 		mdb_ctf_add_union;
89 		mdb_ctf_add_member;
90 		mdb_ctf_add_array;
91 		mdb_ctf_add_pointer;
92 		mdb_ctf_type_id;
93 		mdb_ctf_type_file;
94 		mdb_ctf_member_info;
95 		mdb_ctf_offsetof;
96 		mdb_ctf_num_members;
97 		mdb_ctf_offsetof_by_name;
98 		mdb_ctf_offset_to_name;
99 		mdb_ctf_vread;
100 		mdb_ctf_readsym;
101 
102 		/*
103 		 * Exported functions and variables from:
104 		 *  ../../../common/mdb/mdb_ks.h
105 		 */
106 		mdb_vnode2path;
107 		mdb_page_lookup;
108 		mdb_page2pfn;
109 		mdb_pfn2page;
110 		mdb_pid2proc;
111 		mdb_vtype2chr;
112 		mdb_addr2modctl;
113 		mdb_read_refstr;
114 		mdb_name_to_major;
115 		mdb_major_to_name;
116 		mdb_devinfo2driver;
117 		mdb_devinfo2statep;
118 		mdb_cpu2cpuid;
119 		mdb_cpuset_find;
120 		mdb_gethrtime;
121 		mdb_get_lbolt;
122 		mdb_get_soft_state_byaddr;
123 		mdb_get_soft_state_byname;
124 		mdb_ddi_pathname;
125 		mdb_qops_install;
126 		mdb_qops_remove;
127 		mdb_qname;
128 		mdb_qinfo;
129 		mdb_qrnext;
130 		mdb_qwnext;
131 		mdb_qrnext_default;
132 		mdb_qwnext_default;
133 		mdb_mblk_count;
134 		mdb_dlpi_prim;
135 		mdb_mac_addr;
136 		mdb_kproc_asiter;
137 		mdb_kproc_auxv;
138 		mdb_kproc_as;
139 		mdb_kproc_pid;
140 		mdb_dump_print_content;
141 		mdb_dump_find_curproc;
142 		mdb_ks_init;
143 
144 		/*
145 		 * Exported functions and variables from:
146 		 *  ../../../common/mdb/mdb_modapi.h
147 		 */
148 		mdb_prop_postmortem; /* variable */
149 		mdb_prop_kernel; /* variable */
150 		mdb_pwalk;
151 		mdb_walk;
152 		mdb_pwalk_dcmd;
153 		mdb_walk_dcmd;
154 		mdb_layered_walk;
155 		mdb_call_dcmd;
156 		mdb_add_walker;
157 		mdb_remove_walker;
158 		mdb_vread;
159 		mdb_vwrite;
160 		mdb_aread;
161 		mdb_awrite;
162 		mdb_fread;
163 		mdb_fwrite;
164 		mdb_pread;
165 		mdb_pwrite;
166 		mdb_readstr;
167 		mdb_writestr;
168 		mdb_readsym;
169 		mdb_writesym;
170 		mdb_readvar;
171 		mdb_writevar;
172 		mdb_lookup_by_name;
173 		mdb_lookup_by_obj;
174 		mdb_lookup_by_addr;
175 		mdb_getareg;
176 		mdb_getopts;
177 		mdb_strtoull;
178 		mdb_alloc;
179 		mdb_zalloc;
180 		mdb_free;
181 		mdb_snprintf;
182 		mdb_printf;
183 		mdb_warn;
184 		mdb_flush;
185 		mdb_ffs;
186 		mdb_nhconvert;
187 		mdb_dumpptr;
188 		mdb_dump64;
189 		mdb_one_bit;
190 		mdb_inval_bits;
191 		mdb_inc_indent;
192 		mdb_dec_indent;
193 		mdb_eval;
194 		mdb_set_dot;
195 		mdb_get_dot;
196 		mdb_get_pipe;
197 		mdb_set_pipe;
198 		mdb_get_xdata;
199 		mdb_object_iter;
200 		mdb_symbol_iter;
201 		mdb_get_state;
202 		mdb_callback_add;
203 		mdb_callback_remove;
204 		mdb_tab_insert;
205 		mdb_tab_setmbase;
206 		mdb_tab_complete_type;
207 		mdb_tab_complete_member;
208 		mdb_tab_typename;
209 		mdb_tab_complete_mt;
210 		strlcat;
211 		strcat;
212 		strcpy;
213 		strncpy;
214 		strchr;
215 		strrchr;
216 		strstr;
217 		strcmp;
218 		strncmp;
219 		strcasecmp;
220 		strncasecmp;
221 		strlen;
222 		bcmp;
223 		bcopy;
224 		bzero;
225 		memcpy;
226 		memmove;
227 		memcmp;
228 		memchr;
229 		memset;
230 		memccpy;
231 		bsearch;
232 		qsort;
233 
234 		/*
235 		 * Exported functions and variables from:
236 		 *  ../../../common/mdb/mdb_param.h
237 		 */
238 		_mdb_ks_pagesize; /* variable */
239 		_mdb_ks_pageshift; /* variable */
240 		_mdb_ks_pageoffset; /* variable */
241 		_mdb_ks_pagemask; /* variable */
242 		_mdb_ks_mmu_pagesize; /* variable */
243 		_mdb_ks_mmu_pageshift; /* variable */
244 		_mdb_ks_mmu_pageoffset; /* variable */
245 		_mdb_ks_mmu_pagemask; /* variable */
246 		_mdb_ks_kernelbase; /* variable */
247 		_mdb_ks_userlimit; /* variable */
248 		_mdb_ks_userlimit32; /* variable */
249 		_mdb_ks_argsbase; /* variable */
250 		_mdb_ks_msg_bsize; /* variable */
251 		_mdb_ks_defaultstksz; /* variable */
252 		_mdb_ks_ncpu; /* variable */
253 		_mdb_ks_ncpu_log2; /* variable */
254 		_mdb_ks_ncpu_p2; /* variable */
255 
256 		/*
257 		 * Exported functions and variables from:
258 		 *  ../../../common/mdb/mdb_whatis.h
259 		 */
260 		mdb_whatis_overlaps;
261 		mdb_whatis_match;
262 		mdb_whatis_report_address;
263 		mdb_whatis_report_object;
264 		mdb_whatis_flags;
265 		mdb_whatis_done;
266 		mdb_whatis_register;
267 
268 		/*
269 		 * Exported functions and variables from:
270 		 *  ../../kmdb/kmdb_dpi_isadep.h
271 		 */
272 		kmdb_dpi_handle_fault;
273 		kmdb_dpi_reboot;
274 		kmdb_dpi_msr_add;
275 		kmdb_dpi_msr_get;
276 		kmdb_dpi_msr_get_by_cpu;
277 
278 		/*
279 		 * Secret additions to the module API
280 		 */
281 
282 		/* There should be only one - ours */
283 		errno;		/* variable */
284 		isprint;
285 		isalnum;
286 		isalpha;
287 		isgraph;
288 		iscntrl;
289 		isdigit;
290 		isxdigit;
291 		isupper;
292 		islower;
293 		ispunct;
294 		isspace;
295 
296 		mdb_tgt_aread;
297 		mdb_dis_create;
298 		mdb_dis_destroy;
299 
300 	local:
301 		*;
302 };
303