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 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
29 */
30
31 #ifndef _STRUCT_LAYOUT_H
32 #define _STRUCT_LAYOUT_H
33
34 #include <conv.h>
35 #include <_machelf.h>
36
37 /*
38 * Local include file for elfdump, used to define structure layout
39 * definitions for various system structs.
40 */
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46
47 /*
48 * Solaris defines system structs that elfdump needs to display
518 sl_field_t pr_minor;
519 sl_field_t pr_rmajor;
520 sl_field_t pr_rminor;
521 sl_field_t pr_ino;
522 sl_field_t pr_offset;
523 sl_field_t pr_size;
524 sl_field_t pr_fileflags;
525 sl_field_t pr_fdflags;
526 sl_field_t pr_path;
527 } sl_prfdinfo_layout_t;
528
529 typedef struct {
530 sl_field_t sizeof_struct;
531 sl_field_t pr_version;
532 sl_field_t pr_effective;
533 sl_field_t pr_inherit;
534 sl_field_t pr_lower;
535 sl_field_t pr_upper;
536 } sl_prsecflags_layout_t;
537
538 /*
539 * This type collects all of the layout definitions for
540 * a given architecture.
541 */
542 typedef struct {
543 const sl_auxv_layout_t *auxv; /* auxv_t */
544 const sl_fltset_layout_t *fltset; /* fltset_t */
545 const sl_lwpsinfo_layout_t *lwpsinfo; /* lwpsinfo_t */
546 const sl_lwpstatus_layout_t *lwpstatus; /* lwpstatus_t */
547 const sl_prcred_layout_t *prcred; /* prcred_t */
548 const sl_priv_impl_info_layout_t *priv_impl_info; /* priv_impl_info_t */
549 const sl_prpriv_layout_t *prpriv; /* prpriv_t */
550 const sl_psinfo_layout_t *psinfo; /* psinfo_t */
551 const sl_pstatus_layout_t *pstatus; /* pstatus_t */
552 const sl_prgregset_layout_t *prgregset; /* prgregset_t */
553 const sl_prpsinfo_layout_t *prpsinfo; /* prpsinfo_t */
554 const sl_prstatus_layout_t *prstatus; /* prstatus_t */
555 const sl_sigaction_layout_t *sigaction; /* struct sigaction */
556 const sl_siginfo_layout_t *siginfo; /* siginfo_t */
557 const sl_sigset_layout_t *sigset; /* sigset_t */
558 const sl_stack_layout_t *stack; /* stack_t */
559 const sl_sysset_layout_t *sysset; /* sysset_t */
560 const sl_timestruc_layout_t *timestruc; /* timestruc_t */
561 const sl_utsname_layout_t *utsname; /* struct utsname */
562 const sl_prfdinfo_layout_t *prfdinfo; /* prdinfo_t */
563 const sl_prsecflags_layout_t *prsecflags; /* prsecflags_t */
564 } sl_arch_layout_t;
565
566
567
568 extern void sl_extract_num_field(const char *data, int do_swap,
569 const sl_field_t *fdesc, sl_data_t *field_data);
570 extern Word sl_extract_as_word(const char *data, int do_swap,
571 const sl_field_t *fdesc);
572 extern Lword sl_extract_as_lword(const char *data, int do_swap,
573 const sl_field_t *fdesc);
574 extern Sword sl_extract_as_sword(const char *data, int do_swap,
575 const sl_field_t *fdesc);
576 extern const char *sl_fmt_num(const char *data, int do_swap,
577 const sl_field_t *fdesc, sl_fmt_num_t fmt_type,
578 sl_fmtbuf_t buf);
579
580
581 extern const sl_arch_layout_t *sl_mach(Half);
582 extern const sl_arch_layout_t *struct_layout_i386(void);
583 extern const sl_arch_layout_t *struct_layout_amd64(void);
|
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 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
29 * Copyright 2018 Joyent, Inc.
30 */
31
32 #ifndef _STRUCT_LAYOUT_H
33 #define _STRUCT_LAYOUT_H
34
35 #include <conv.h>
36 #include <_machelf.h>
37
38 /*
39 * Local include file for elfdump, used to define structure layout
40 * definitions for various system structs.
41 */
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47
48 /*
49 * Solaris defines system structs that elfdump needs to display
519 sl_field_t pr_minor;
520 sl_field_t pr_rmajor;
521 sl_field_t pr_rminor;
522 sl_field_t pr_ino;
523 sl_field_t pr_offset;
524 sl_field_t pr_size;
525 sl_field_t pr_fileflags;
526 sl_field_t pr_fdflags;
527 sl_field_t pr_path;
528 } sl_prfdinfo_layout_t;
529
530 typedef struct {
531 sl_field_t sizeof_struct;
532 sl_field_t pr_version;
533 sl_field_t pr_effective;
534 sl_field_t pr_inherit;
535 sl_field_t pr_lower;
536 sl_field_t pr_upper;
537 } sl_prsecflags_layout_t;
538
539 typedef struct {
540 sl_field_t sizeof_struct;
541 sl_field_t pr_lwpid;
542 sl_field_t pr_lwpname;
543 } sl_prlwpname_layout_t;
544
545 /*
546 * This type collects all of the layout definitions for
547 * a given architecture.
548 */
549 typedef struct {
550 const sl_auxv_layout_t *auxv; /* auxv_t */
551 const sl_fltset_layout_t *fltset; /* fltset_t */
552 const sl_lwpsinfo_layout_t *lwpsinfo; /* lwpsinfo_t */
553 const sl_lwpstatus_layout_t *lwpstatus; /* lwpstatus_t */
554 const sl_prcred_layout_t *prcred; /* prcred_t */
555 const sl_priv_impl_info_layout_t *priv_impl_info; /* priv_impl_info_t */
556 const sl_prpriv_layout_t *prpriv; /* prpriv_t */
557 const sl_psinfo_layout_t *psinfo; /* psinfo_t */
558 const sl_pstatus_layout_t *pstatus; /* pstatus_t */
559 const sl_prgregset_layout_t *prgregset; /* prgregset_t */
560 const sl_prpsinfo_layout_t *prpsinfo; /* prpsinfo_t */
561 const sl_prstatus_layout_t *prstatus; /* prstatus_t */
562 const sl_sigaction_layout_t *sigaction; /* struct sigaction */
563 const sl_siginfo_layout_t *siginfo; /* siginfo_t */
564 const sl_sigset_layout_t *sigset; /* sigset_t */
565 const sl_stack_layout_t *stack; /* stack_t */
566 const sl_sysset_layout_t *sysset; /* sysset_t */
567 const sl_timestruc_layout_t *timestruc; /* timestruc_t */
568 const sl_utsname_layout_t *utsname; /* struct utsname */
569 const sl_prfdinfo_layout_t *prfdinfo; /* prdinfo_t */
570 const sl_prsecflags_layout_t *prsecflags; /* prsecflags_t */
571 const sl_prlwpname_layout_t *prlwpname; /* prlwpname_t */
572 } sl_arch_layout_t;
573
574
575
576 extern void sl_extract_num_field(const char *data, int do_swap,
577 const sl_field_t *fdesc, sl_data_t *field_data);
578 extern Word sl_extract_as_word(const char *data, int do_swap,
579 const sl_field_t *fdesc);
580 extern Lword sl_extract_as_lword(const char *data, int do_swap,
581 const sl_field_t *fdesc);
582 extern Sword sl_extract_as_sword(const char *data, int do_swap,
583 const sl_field_t *fdesc);
584 extern const char *sl_fmt_num(const char *data, int do_swap,
585 const sl_field_t *fdesc, sl_fmt_num_t fmt_type,
586 sl_fmtbuf_t buf);
587
588
589 extern const sl_arch_layout_t *sl_mach(Half);
590 extern const sl_arch_layout_t *struct_layout_i386(void);
591 extern const sl_arch_layout_t *struct_layout_amd64(void);
|