Print this page
Code review comments from pmooney (sundry), and igork (screwups in zonecfg refactoring)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c
+++ new/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26 /*
27 27 * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
28 28 */
29 29 #include <struct_layout.h>
30 30
31 31
32 32 static const sl_auxv_layout_t auxv_layout = {
33 33 { 0, 8, 0, 0 }, /* sizeof (auxv_t) */
34 34 { 0, 4, 0, 1 }, /* a_type */
35 35 { 4, 4, 0, 1 }, /* a_un.a_val */
36 36 { 4, 4, 0, 0 }, /* a_un.a_ptr */
37 37 { 4, 4, 0, 0 }, /* a_un.a_fcn */
38 38 };
39 39
40 40
41 41 static const sl_prgregset_layout_t prgregset_layout = {
42 42 { 0, 152, 0, 0 }, /* sizeof (prgregset_t) */
43 43 { 0, 4, 38, 0 }, /* elt0 */
44 44 };
45 45
46 46
47 47 static const sl_lwpstatus_layout_t lwpstatus_layout = {
48 48 { 0, 896, 0, 0 }, /* sizeof (lwpstatus_t) */
49 49 { 0, 4, 0, 0 }, /* pr_flags */
50 50 { 4, 4, 0, 0 }, /* pr_lwpid */
51 51 { 8, 2, 0, 0 }, /* pr_why */
52 52 { 10, 2, 0, 0 }, /* pr_what */
53 53 { 12, 2, 0, 0 }, /* pr_cursig */
54 54 { 16, 128, 0, 0 }, /* pr_info */
55 55 { 144, 16, 0, 0 }, /* pr_lwppend */
56 56 { 160, 16, 0, 0 }, /* pr_lwphold */
57 57 { 176, 32, 0, 0 }, /* pr_action */
58 58 { 208, 12, 0, 0 }, /* pr_altstack */
59 59 { 220, 4, 0, 0 }, /* pr_oldcontext */
60 60 { 224, 2, 0, 0 }, /* pr_syscall */
61 61 { 226, 2, 0, 0 }, /* pr_nsysarg */
62 62 { 228, 4, 0, 0 }, /* pr_errno */
63 63 { 232, 4, 8, 0 }, /* pr_sysarg[] */
64 64 { 264, 4, 0, 0 }, /* pr_rval1 */
65 65 { 268, 4, 0, 0 }, /* pr_rval2 */
66 66 { 272, 1, 8, 0 }, /* pr_clname[] */
67 67 { 280, 8, 0, 0 }, /* pr_tstamp */
68 68 { 288, 8, 0, 0 }, /* pr_utime */
69 69 { 296, 8, 0, 0 }, /* pr_stime */
70 70 { 332, 4, 0, 0 }, /* pr_errpriv */
71 71 { 336, 4, 0, 0 }, /* pr_ustack */
72 72 { 340, 4, 0, 0 }, /* pr_instr */
73 73 { 344, 152, 0, 0 }, /* pr_reg */
74 74 { 496, 400, 0, 0 }, /* pr_fpreg */
75 75 };
76 76
77 77
78 78 static const sl_pstatus_layout_t pstatus_layout = {
79 79 { 0, 1232, 0, 0 }, /* sizeof (pstatus_t) */
80 80 { 0, 4, 0, 1 }, /* pr_flags */
81 81 { 4, 4, 0, 1 }, /* pr_nlwp */
82 82 { 8, 4, 0, 0 }, /* pr_pid */
83 83 { 12, 4, 0, 0 }, /* pr_ppid */
84 84 { 16, 4, 0, 0 }, /* pr_pgid */
85 85 { 20, 4, 0, 0 }, /* pr_sid */
86 86 { 24, 4, 0, 1 }, /* pr_aslwpid */
87 87 { 28, 4, 0, 1 }, /* pr_agentid */
88 88 { 32, 16, 0, 0 }, /* pr_sigpend */
89 89 { 48, 4, 0, 0 }, /* pr_brkbase */
90 90 { 52, 4, 0, 0 }, /* pr_brksize */
91 91 { 56, 4, 0, 0 }, /* pr_stkbase */
92 92 { 60, 4, 0, 0 }, /* pr_stksize */
93 93 { 64, 8, 0, 0 }, /* pr_utime */
94 94 { 72, 8, 0, 0 }, /* pr_stime */
95 95 { 80, 8, 0, 0 }, /* pr_cutime */
96 96 { 88, 8, 0, 0 }, /* pr_cstime */
97 97 { 96, 16, 0, 0 }, /* pr_sigtrace */
98 98 { 112, 16, 0, 0 }, /* pr_flttrace */
99 99 { 128, 64, 0, 0 }, /* pr_sysentry */
100 100 { 192, 64, 0, 0 }, /* pr_sysexit */
101 101 { 256, 1, 0, 0 }, /* pr_dmodel */
102 102 { 260, 4, 0, 1 }, /* pr_taskid */
103 103 { 264, 4, 0, 1 }, /* pr_projid */
104 104 { 268, 4, 0, 1 }, /* pr_nzomb */
105 105 { 272, 4, 0, 1 }, /* pr_zoneid */
106 106 { 336, 896, 0, 0 }, /* pr_lwp */
107 107 };
108 108
109 109
110 110 static const sl_prstatus_layout_t prstatus_layout = {
111 111 { 0, 508, 0, 0 }, /* sizeof (prstatus_t) */
112 112 { 0, 4, 0, 1 }, /* pr_flags */
113 113 { 4, 2, 0, 1 }, /* pr_why */
114 114 { 6, 2, 0, 1 }, /* pr_what */
115 115 { 8, 128, 0, 0 }, /* pr_info */
116 116 { 136, 2, 0, 1 }, /* pr_cursig */
117 117 { 138, 2, 0, 0 }, /* pr_nlwp */
118 118 { 140, 16, 0, 0 }, /* pr_sigpend */
119 119 { 156, 16, 0, 0 }, /* pr_sighold */
120 120 { 172, 12, 0, 0 }, /* pr_altstack */
121 121 { 184, 32, 0, 0 }, /* pr_action */
122 122 { 216, 4, 0, 0 }, /* pr_pid */
123 123 { 220, 4, 0, 0 }, /* pr_ppid */
124 124 { 224, 4, 0, 0 }, /* pr_pgrp */
125 125 { 228, 4, 0, 0 }, /* pr_sid */
126 126 { 232, 8, 0, 0 }, /* pr_utime */
127 127 { 240, 8, 0, 0 }, /* pr_stime */
128 128 { 248, 8, 0, 0 }, /* pr_cutime */
129 129 { 256, 8, 0, 0 }, /* pr_cstime */
130 130 { 264, 1, 8, 0 }, /* pr_clname[] */
131 131 { 272, 2, 0, 1 }, /* pr_syscall */
132 132 { 274, 2, 0, 1 }, /* pr_nsysarg */
133 133 { 276, 4, 8, 1 }, /* pr_sysarg[] */
134 134 { 308, 4, 0, 0 }, /* pr_who */
135 135 { 312, 16, 0, 0 }, /* pr_lwppend */
136 136 { 328, 4, 0, 0 }, /* pr_oldcontext */
137 137 { 332, 4, 0, 0 }, /* pr_brkbase */
138 138 { 336, 4, 0, 0 }, /* pr_brksize */
139 139 { 340, 4, 0, 0 }, /* pr_stkbase */
140 140 { 344, 4, 0, 0 }, /* pr_stksize */
141 141 { 348, 2, 0, 1 }, /* pr_processor */
142 142 { 350, 2, 0, 1 }, /* pr_bind */
143 143 { 352, 4, 0, 1 }, /* pr_instr */
144 144 { 356, 152, 0, 0 }, /* pr_reg */
145 145 };
146 146
147 147
148 148 static const sl_psinfo_layout_t psinfo_layout = {
149 149 { 0, 336, 0, 0 }, /* sizeof (psinfo_t) */
150 150 { 0, 4, 0, 1 }, /* pr_flag */
151 151 { 4, 4, 0, 1 }, /* pr_nlwp */
152 152 { 8, 4, 0, 0 }, /* pr_pid */
153 153 { 12, 4, 0, 0 }, /* pr_ppid */
154 154 { 16, 4, 0, 0 }, /* pr_pgid */
155 155 { 20, 4, 0, 0 }, /* pr_sid */
156 156 { 24, 4, 0, 0 }, /* pr_uid */
157 157 { 28, 4, 0, 0 }, /* pr_euid */
158 158 { 32, 4, 0, 0 }, /* pr_gid */
159 159 { 36, 4, 0, 0 }, /* pr_egid */
160 160 { 40, 4, 0, 0 }, /* pr_addr */
161 161 { 44, 4, 0, 0 }, /* pr_size */
162 162 { 48, 4, 0, 0 }, /* pr_rssize */
163 163 { 56, 4, 0, 0 }, /* pr_ttydev */
164 164 { 60, 2, 0, 0 }, /* pr_pctcpu */
165 165 { 62, 2, 0, 0 }, /* pr_pctmem */
166 166 { 64, 8, 0, 0 }, /* pr_start */
167 167 { 72, 8, 0, 0 }, /* pr_time */
168 168 { 80, 8, 0, 0 }, /* pr_ctime */
169 169 { 88, 1, 16, 0 }, /* pr_fname[] */
170 170 { 104, 1, 80, 0 }, /* pr_psargs[] */
171 171 { 184, 4, 0, 1 }, /* pr_wstat */
172 172 { 188, 4, 0, 1 }, /* pr_argc */
173 173 { 192, 4, 0, 0 }, /* pr_argv */
174 174 { 196, 4, 0, 0 }, /* pr_envp */
175 175 { 200, 1, 0, 0 }, /* pr_dmodel */
176 176 { 204, 4, 0, 0 }, /* pr_taskid */
177 177 { 208, 4, 0, 0 }, /* pr_projid */
178 178 { 212, 4, 0, 1 }, /* pr_nzomb */
179 179 { 216, 4, 0, 0 }, /* pr_poolid */
180 180 { 220, 4, 0, 0 }, /* pr_zoneid */
181 181 { 224, 4, 0, 0 }, /* pr_contract */
182 182 { 232, 104, 0, 0 }, /* pr_lwp */
183 183 };
184 184
185 185
186 186 static const sl_prpsinfo_layout_t prpsinfo_layout = {
187 187 { 0, 260, 0, 0 }, /* sizeof (prpsinfo_t) */
188 188 { 0, 1, 0, 0 }, /* pr_state */
189 189 { 1, 1, 0, 0 }, /* pr_sname */
190 190 { 2, 1, 0, 0 }, /* pr_zomb */
191 191 { 3, 1, 0, 0 }, /* pr_nice */
192 192 { 4, 4, 0, 0 }, /* pr_flag */
193 193 { 8, 4, 0, 0 }, /* pr_uid */
194 194 { 12, 4, 0, 0 }, /* pr_gid */
195 195 { 16, 4, 0, 0 }, /* pr_pid */
196 196 { 20, 4, 0, 0 }, /* pr_ppid */
197 197 { 24, 4, 0, 0 }, /* pr_pgrp */
198 198 { 28, 4, 0, 0 }, /* pr_sid */
199 199 { 32, 4, 0, 0 }, /* pr_addr */
200 200 { 36, 4, 0, 0 }, /* pr_size */
201 201 { 40, 4, 0, 0 }, /* pr_rssize */
202 202 { 44, 4, 0, 0 }, /* pr_wchan */
203 203 { 48, 8, 0, 0 }, /* pr_start */
204 204 { 56, 8, 0, 0 }, /* pr_time */
205 205 { 64, 4, 0, 1 }, /* pr_pri */
206 206 { 68, 1, 0, 0 }, /* pr_oldpri */
207 207 { 69, 1, 0, 0 }, /* pr_cpu */
208 208 { 70, 2, 0, 0 }, /* pr_ottydev */
209 209 { 72, 4, 0, 0 }, /* pr_lttydev */
210 210 { 76, 1, 8, 0 }, /* pr_clname[] */
211 211 { 84, 1, 16, 0 }, /* pr_fname[] */
212 212 { 100, 1, 80, 0 }, /* pr_psargs[] */
213 213 { 180, 2, 0, 1 }, /* pr_syscall */
214 214 { 184, 8, 0, 0 }, /* pr_ctime */
215 215 { 192, 4, 0, 0 }, /* pr_bysize */
216 216 { 196, 4, 0, 0 }, /* pr_byrssize */
217 217 { 200, 4, 0, 1 }, /* pr_argc */
218 218 { 204, 4, 0, 0 }, /* pr_argv */
219 219 { 208, 4, 0, 0 }, /* pr_envp */
220 220 { 212, 4, 0, 1 }, /* pr_wstat */
221 221 { 216, 2, 0, 0 }, /* pr_pctcpu */
222 222 { 218, 2, 0, 0 }, /* pr_pctmem */
223 223 { 220, 4, 0, 0 }, /* pr_euid */
224 224 { 224, 4, 0, 0 }, /* pr_egid */
225 225 { 228, 4, 0, 0 }, /* pr_aslwpid */
226 226 { 232, 1, 0, 0 }, /* pr_dmodel */
227 227 };
228 228
229 229
230 230 static const sl_lwpsinfo_layout_t lwpsinfo_layout = {
231 231 { 0, 104, 0, 0 }, /* sizeof (lwpsinfo_t) */
232 232 { 0, 4, 0, 1 }, /* pr_flag */
233 233 { 4, 4, 0, 0 }, /* pr_lwpid */
234 234 { 8, 4, 0, 0 }, /* pr_addr */
235 235 { 12, 4, 0, 0 }, /* pr_wchan */
236 236 { 16, 1, 0, 0 }, /* pr_stype */
237 237 { 17, 1, 0, 0 }, /* pr_state */
238 238 { 18, 1, 0, 0 }, /* pr_sname */
239 239 { 19, 1, 0, 0 }, /* pr_nice */
240 240 { 20, 2, 0, 0 }, /* pr_syscall */
241 241 { 22, 1, 0, 0 }, /* pr_oldpri */
242 242 { 23, 1, 0, 0 }, /* pr_cpu */
243 243 { 24, 4, 0, 1 }, /* pr_pri */
244 244 { 28, 2, 0, 0 }, /* pr_pctcpu */
245 245 { 32, 8, 0, 0 }, /* pr_start */
246 246 { 40, 8, 0, 0 }, /* pr_time */
247 247 { 48, 1, 8, 0 }, /* pr_clname[] */
248 248 { 56, 1, 16, 0 }, /* pr_name[] */
249 249 { 72, 4, 0, 1 }, /* pr_onpro */
250 250 { 76, 4, 0, 1 }, /* pr_bindpro */
251 251 { 80, 4, 0, 1 }, /* pr_bindpset */
252 252 { 84, 4, 0, 1 }, /* pr_lgrp */
253 253 };
254 254
255 255
256 256 static const sl_prcred_layout_t prcred_layout = {
257 257 { 0, 32, 0, 0 }, /* sizeof (prcred_t) */
258 258 { 0, 4, 0, 0 }, /* pr_euid */
259 259 { 4, 4, 0, 0 }, /* pr_ruid */
260 260 { 8, 4, 0, 0 }, /* pr_suid */
261 261 { 12, 4, 0, 0 }, /* pr_egid */
262 262 { 16, 4, 0, 0 }, /* pr_rgid */
263 263 { 20, 4, 0, 0 }, /* pr_sgid */
264 264 { 24, 4, 0, 1 }, /* pr_ngroups */
265 265 { 28, 4, 1, 0 }, /* pr_groups[] */
266 266 };
267 267
268 268
269 269 static const sl_prpriv_layout_t prpriv_layout = {
270 270 { 0, 16, 0, 0 }, /* sizeof (prpriv_t) */
271 271 { 0, 4, 0, 0 }, /* pr_nsets */
272 272 { 4, 4, 0, 0 }, /* pr_setsize */
273 273 { 8, 4, 0, 0 }, /* pr_infosize */
274 274 { 12, 4, 1, 0 }, /* pr_sets[] */
275 275 };
276 276
277 277
278 278 static const sl_priv_impl_info_layout_t priv_impl_info_layout = {
279 279 { 0, 28, 0, 0 }, /* sizeof (priv_impl_info_t) */
280 280 { 0, 4, 0, 0 }, /* priv_headersize */
281 281 { 4, 4, 0, 0 }, /* priv_flags */
282 282 { 8, 4, 0, 0 }, /* priv_nsets */
283 283 { 12, 4, 0, 0 }, /* priv_setsize */
284 284 { 16, 4, 0, 0 }, /* priv_max */
285 285 { 20, 4, 0, 0 }, /* priv_infosize */
286 286 { 24, 4, 0, 0 }, /* priv_globalinfosize */
287 287 };
288 288
289 289
290 290 static const sl_fltset_layout_t fltset_layout = {
291 291 { 0, 16, 0, 0 }, /* sizeof (fltset_t) */
292 292 { 0, 4, 4, 0 }, /* word[] */
293 293 };
294 294
295 295
296 296 static const sl_siginfo_layout_t siginfo_layout = {
297 297 { 0, 128, 0, 0 }, /* sizeof (siginfo_t) */
298 298 { 0, 4, 0, 0 }, /* si_signo */
299 299 { 8, 4, 0, 0 }, /* si_errno */
300 300 { 4, 4, 0, 1 }, /* si_code */
301 301 { 20, 4, 0, 0 }, /* si_value.sival_int */
302 302 { 20, 4, 0, 0 }, /* si_value.sival_ptr */
303 303 { 12, 4, 0, 0 }, /* si_pid */
304 304 { 16, 4, 0, 0 }, /* si_uid */
305 305 { 28, 4, 0, 0 }, /* si_ctid */
306 306 { 32, 4, 0, 0 }, /* si_zoneid */
307 307 { 12, 4, 0, 0 }, /* si_entity */
308 308 { 12, 4, 0, 0 }, /* si_addr */
309 309 { 20, 4, 0, 0 }, /* si_status */
310 310 { 16, 4, 0, 0 }, /* si_band */
311 311 };
312 312
313 313
314 314 static const sl_sigset_layout_t sigset_layout = {
315 315 { 0, 16, 0, 0 }, /* sizeof (sigset_t) */
316 316 { 0, 4, 4, 0 }, /* __sigbits[] */
317 317 };
318 318
319 319
320 320 static const sl_sigaction_layout_t sigaction_layout = {
321 321 { 0, 32, 0, 0 }, /* sizeof (struct sigaction) */
322 322 { 0, 4, 0, 0 }, /* sa_flags */
323 323 { 4, 4, 0, 0 }, /* sa_handler */
324 324 { 4, 4, 0, 0 }, /* sa_sigaction */
325 325 { 8, 16, 0, 0 }, /* sa_mask */
326 326 };
327 327
328 328
329 329 static const sl_stack_layout_t stack_layout = {
330 330 { 0, 12, 0, 0 }, /* sizeof (stack_t) */
331 331 { 0, 4, 0, 0 }, /* ss_sp */
332 332 { 4, 4, 0, 0 }, /* ss_size */
333 333 { 8, 4, 0, 0 }, /* ss_flags */
334 334 };
335 335
336 336
337 337 static const sl_sysset_layout_t sysset_layout = {
338 338 { 0, 64, 0, 0 }, /* sizeof (sysset_t) */
339 339 { 0, 4, 16, 0 }, /* word[] */
340 340 };
341 341
342 342
343 343 static const sl_timestruc_layout_t timestruc_layout = {
344 344 { 0, 8, 0, 0 }, /* sizeof (timestruc_t) */
345 345 { 0, 4, 0, 0 }, /* tv_sec */
346 346 { 4, 4, 0, 0 }, /* tv_nsec */
347 347 };
348 348
349 349
350 350 static const sl_utsname_layout_t utsname_layout = {
351 351 { 0, 1285, 0, 0 }, /* sizeof (struct utsname) */
352 352 { 0, 1, 257, 0 }, /* sysname[] */
353 353 { 257, 1, 257, 0 }, /* nodename[] */
354 354 { 514, 1, 257, 0 }, /* release[] */
355 355 { 771, 1, 257, 0 }, /* version[] */
356 356 { 1028, 1, 257, 0 }, /* machine[] */
357 357 };
358 358
359 359
360 360 static const sl_prfdinfo_layout_t prfdinfo_layout = {
361 361 { 0, 1088, 0, 0 }, /* sizeof (prfdinfo_t) */
362 362 { 0, 4, 0, 0 }, /* pr_fd */
363 363 { 4, 4, 0, 0 }, /* pr_mode */
364 364 { 8, 4, 0, 0 }, /* pr_uid */
365 365 { 12, 4, 0, 0 }, /* pr_gid */
366 366 { 16, 4, 0, 0 }, /* pr_major */
367 367 { 20, 4, 0, 0 }, /* pr_minor */
368 368 { 24, 4, 0, 0 }, /* pr_rmajor */
↓ open down ↓ |
368 lines elided |
↑ open up ↑ |
369 369 { 28, 4, 0, 0 }, /* pr_rminor */
370 370 { 32, 8, 0, 0 }, /* pr_ino */
371 371 { 40, 8, 0, 0 }, /* pr_offset */
372 372 { 48, 8, 0, 0 }, /* pr_size */
373 373 { 56, 4, 0, 0 }, /* pr_fileflags */
374 374 { 60, 4, 0, 0 }, /* pr_fdflags */
375 375 { 64, 1, 1024, 0 }, /* pr_path[] */
376 376 };
377 377
378 378
379 +static const sl_prsecflags_layout_t prsecflags_layout = {
380 + { 0, 20, 0, 0 }, /* sizeof (prsecflags_t) */
381 + { 0, 4, 0, 0 }, /* pr_version */
382 + { 4, 4, 0, 0 }, /* pr_effective */
383 + { 8, 4, 0, 0 }, /* pr_inherit */
384 + { 12, 4, 0, 0 }, /* pr_lower */
385 + { 16, 4, 0, 0 }, /* pr_upper */
386 +};
387 +
388 +
379 389
380 390
381 391 static const sl_arch_layout_t layout_sparc = {
382 392 &auxv_layout,
383 393 &fltset_layout,
384 394 &lwpsinfo_layout,
385 395 &lwpstatus_layout,
386 396 &prcred_layout,
387 397 &priv_impl_info_layout,
388 398 &prpriv_layout,
389 399 &psinfo_layout,
390 400 &pstatus_layout,
391 401 &prgregset_layout,
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
392 402 &prpsinfo_layout,
393 403 &prstatus_layout,
394 404 &sigaction_layout,
395 405 &siginfo_layout,
396 406 &sigset_layout,
397 407 &stack_layout,
398 408 &sysset_layout,
399 409 ×truc_layout,
400 410 &utsname_layout,
401 411 &prfdinfo_layout,
412 + &prsecflags_layout,
402 413 };
403 414
404 415
405 416 const sl_arch_layout_t *
406 417 struct_layout_sparc(void)
407 418 {
408 419 return (&layout_sparc);
409 420 }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX