Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/elfdump/common/gen_struct_layout.c
          +++ new/usr/src/cmd/sgs/elfdump/common/gen_struct_layout.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  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   * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
       27 + * Copyright 2018 Joyent, Inc.
  27   28   */
  28   29  
  29   30  /*
  30   31   * This program is used to generate the contents of the
  31      - * struct_layout_XXX.c files that contain per-archtecture
       32 + * struct_layout_XXX.c files that contain per-architecture
  32   33   * structure layout information.
  33   34   *
  34   35   * Although not part of elfdump, it is built by the makefile
  35   36   * along with it.
  36   37   * To use it:
  37   38   *
  38   39   *      1) Run it, capturing the output in a file.
  39   40   *      2) If this is a replacement for an existing file,
  40   41   *              diff the new and old copies to ensure only
  41   42   *              the changes you expected are present.
↓ open down ↓ 550 lines elided ↑ open up ↑
 592  593  {
 593  594          START(prsecflags, prsecflags_t);
 594  595          SCALAR_FIELD(prsecflags_t, pr_version, 0);
 595  596          SCALAR_FIELD(prsecflags_t, pr_effective, 0);
 596  597          SCALAR_FIELD(prsecflags_t, pr_inherit, 0);
 597  598          SCALAR_FIELD(prsecflags_t, pr_lower, 0);
 598  599          SCALAR_FIELD(prsecflags_t, pr_upper, 0);
 599  600          END;
 600  601  }
 601  602  
      603 +static void
      604 +gen_prlwpname(void)
      605 +{
      606 +        START(prlwpname, prlwpname_t);
      607 +        SCALAR_FIELD(prlwpname_t, pr_lwpid, 0);
      608 +        ARRAY_FIELD(prlwpname_t, pr_lwpname, 0);
      609 +        END;
      610 +}
      611 +
 602  612  /*ARGSUSED*/
 603  613  int
 604  614  main(int argc, char *argv[])
 605  615  {
 606  616          const char *fmt = "\t&%s_layout,\n";
 607  617  
 608  618          /* get obj file for input */
 609  619          if (argc < 3) {
 610  620                  (void) fprintf(stderr,
 611  621                      "usage: %s {object_file} {MACH}\n", argv[0]);
↓ open down ↓ 21 lines elided ↑ open up ↑
 633  643          gen_fltset();
 634  644          gen_siginfo();
 635  645          gen_sigset();
 636  646          gen_sigaction();
 637  647          gen_stack();
 638  648          gen_sysset();
 639  649          gen_timestruc();
 640  650          gen_utsname();
 641  651          gen_prfdinfo();
 642  652          gen_prsecflags();
      653 +        gen_prlwpname();
 643  654  
 644  655          /*
 645  656           * Generate the full arch_layout description
 646  657           */
 647  658          (void) printf(
 648  659              "\n\n\n\nstatic const sl_arch_layout_t layout_%s = {\n",
 649  660              machname);
 650  661          (void) printf(fmt, "auxv");
 651  662          (void) printf(fmt, "fltset");
 652  663          (void) printf(fmt, "lwpsinfo");
↓ open down ↓ 8 lines elided ↑ open up ↑
 661  672          (void) printf(fmt, "prstatus");
 662  673          (void) printf(fmt, "sigaction");
 663  674          (void) printf(fmt, "siginfo");
 664  675          (void) printf(fmt, "sigset");
 665  676          (void) printf(fmt, "stack");
 666  677          (void) printf(fmt, "sysset");
 667  678          (void) printf(fmt, "timestruc");
 668  679          (void) printf(fmt, "utsname");
 669  680          (void) printf(fmt, "prfdinfo");
 670  681          (void) printf(fmt, "prsecflags");
      682 +        (void) printf(fmt, "prlwpname");
 671  683          (void) printf("};\n");
 672  684  
 673  685          /*
 674  686           * A public function, to make the information available
 675  687           */
 676  688          (void) printf("\n\nconst sl_arch_layout_t *\n");
 677  689          (void) printf("struct_layout_%s(void)\n", machname);
 678  690          (void) printf("{\n\treturn (&layout_%s);\n}\n", machname);
 679  691  
 680  692          return (0);
↓ open down ↓ 286 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX