Home | History | Annotate | Download | only in common
      1  6635  ab196087 /*
      2  6635  ab196087  * CDDL HEADER START
      3  6635  ab196087  *
      4  6635  ab196087  * The contents of this file are subject to the terms of the
      5  6635  ab196087  * Common Development and Distribution License (the "License").
      6  6635  ab196087  * You may not use this file except in compliance with the License.
      7  6635  ab196087  *
      8  6635  ab196087  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9  6635  ab196087  * or http://www.opensolaris.org/os/licensing.
     10  6635  ab196087  * See the License for the specific language governing permissions
     11  6635  ab196087  * and limitations under the License.
     12  6635  ab196087  *
     13  6635  ab196087  * When distributing Covered Code, include this CDDL HEADER in each
     14  6635  ab196087  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15  6635  ab196087  * If applicable, add the following below this CDDL HEADER, with the
     16  6635  ab196087  * fields enclosed by brackets "[]" replaced with your own identifying
     17  6635  ab196087  * information: Portions Copyright [yyyy] [name of copyright owner]
     18  6635  ab196087  *
     19  6635  ab196087  * CDDL HEADER END
     20  6635  ab196087  */
     21  6635  ab196087 
     22  6635  ab196087 /*
     23  9273       Ali  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     24  6635  ab196087  * Use is subject to license terms.
     25  6635  ab196087  */
     26  6635  ab196087 
     27  6635  ab196087 /*
     28  6635  ab196087  * String conversion routines the system structs found in
     29  6635  ab196087  * Solaris core file note sections. These items are not
     30  6635  ab196087  * ELF constructs. However, elfdump contains code for decoding
     31  6635  ab196087  * them, and therefore requires formatting support.
     32  6635  ab196087  */
     33  6635  ab196087 #include	<stdio.h>
     34  6635  ab196087 #include	<procfs.h>
     35  6635  ab196087 #include	<sys/corectl.h>
     36  6635  ab196087 #include	<string.h>
     37  6635  ab196087 #include	<_conv.h>
     38  6635  ab196087 #include	<corenote_msg.h>
     39  6635  ab196087 
     40  6635  ab196087 const char *
     41  6635  ab196087 conv_cnote_type(Word type, Conv_fmt_flags_t fmt_flags,
     42  6635  ab196087     Conv_inv_buf_t *inv_buf)
     43  6635  ab196087 {
     44  6635  ab196087 	static const Msg	types[] = {
     45  6635  ab196087 		MSG_NT_PRSTATUS,	MSG_NT_PRFPREG,
     46  6635  ab196087 		MSG_NT_PRPSINFO,	MSG_NT_PRXREG,
     47  6635  ab196087 		MSG_NT_PLATFORM,	MSG_NT_AUXV,
     48  6635  ab196087 		MSG_NT_GWINDOWS,	MSG_NT_ASRS,
     49  6635  ab196087 		MSG_NT_LDT,		MSG_NT_PSTATUS,
     50  9273       Ali 		0,			0,
     51  6635  ab196087 		MSG_NT_PSINFO,		MSG_NT_PRCRED,
     52  6635  ab196087 		MSG_NT_UTSNAME,		MSG_NT_LWPSTATUS,
     53  6635  ab196087 		MSG_NT_LWPSINFO,	MSG_NT_PRPRIV,
     54  6635  ab196087 		MSG_NT_PRPRIVINFO,	MSG_NT_CONTENT,
     55  6635  ab196087 		MSG_NT_ZONENAME
     56  6635  ab196087 	};
     57  6635  ab196087 #if NT_NUM != NT_ZONENAME
     58  6635  ab196087 #error "NT_NUM has grown. Update core note types[]"
     59  6635  ab196087 #endif
     60  9273       Ali 	static const conv_ds_msg_t ds_types = {
     61  9273       Ali 	    CONV_DS_MSG_INIT(NT_PRSTATUS, types) };
     62  9273       Ali 	static const conv_ds_t	*ds[] = { CONV_DS_ADDR(ds_types), NULL };
     63  6635  ab196087 
     64  6635  ab196087 
     65  9273       Ali 	return (conv_map_ds(ELFOSABI_NONE, EM_NONE, type, ds, fmt_flags,
     66  9273       Ali 	    inv_buf));
     67  6635  ab196087 }
     68  6635  ab196087 
     69  6635  ab196087 
     70  6635  ab196087 const char *
     71  6635  ab196087 conv_cnote_auxv_type(Word type, Conv_fmt_flags_t fmt_flags,
     72  6635  ab196087     Conv_inv_buf_t *inv_buf)
     73  6635  ab196087 {
     74  6635  ab196087 	static const Msg	types_0_22[] = {
     75  6635  ab196087 		MSG_AUXV_AT_NULL,		MSG_AUXV_AT_IGNORE,
     76  6635  ab196087 		MSG_AUXV_AT_EXECFD,		MSG_AUXV_AT_PHDR,
     77  6635  ab196087 		MSG_AUXV_AT_PHENT,		MSG_AUXV_AT_PHNUM,
     78  6635  ab196087 		MSG_AUXV_AT_PAGESZ,		MSG_AUXV_AT_BASE,
     79  6635  ab196087 		MSG_AUXV_AT_FLAGS,		MSG_AUXV_AT_ENTRY,
     80  6635  ab196087 		MSG_AUXV_AT_NOTELF,		MSG_AUXV_AT_UID,
     81  6635  ab196087 		MSG_AUXV_AT_EUID,		MSG_AUXV_AT_GID,
     82  6635  ab196087 		MSG_AUXV_AT_EGID,		MSG_AUXV_AT_PLATFORM,
     83  6635  ab196087 		MSG_AUXV_AT_HWCAP,		MSG_AUXV_AT_CLKTCK,
     84  6635  ab196087 		MSG_AUXV_AT_FPUCW,		MSG_AUXV_AT_DCACHEBSIZE,
     85  6635  ab196087 		MSG_AUXV_AT_ICACHEBSIZE,	MSG_AUXV_AT_UCACHEBSIZE,
     86  6635  ab196087 		MSG_AUXV_AT_IGNOREPPC
     87  6635  ab196087 	};
     88  9273       Ali 	static const conv_ds_msg_t ds_types_0_22 = {
     89  9273       Ali 	    CONV_DS_MSG_INIT(0, types_0_22) };
     90  9273       Ali 
     91  6635  ab196087 	static const Msg	types_2000_2011[] = {
     92  6635  ab196087 		MSG_AUXV_AT_SUN_UID,		MSG_AUXV_AT_SUN_RUID,
     93  6635  ab196087 		MSG_AUXV_AT_SUN_GID,		MSG_AUXV_AT_SUN_RGID,
     94  6635  ab196087 		MSG_AUXV_AT_SUN_LDELF,		MSG_AUXV_AT_SUN_LDSHDR,
     95  6635  ab196087 		MSG_AUXV_AT_SUN_LDNAME,		MSG_AUXV_AT_SUN_LPAGESZ,
     96  6635  ab196087 		MSG_AUXV_AT_SUN_PLATFORM,	MSG_AUXV_AT_SUN_HWCAP,
     97  6635  ab196087 		MSG_AUXV_AT_SUN_IFLUSH,		MSG_AUXV_AT_SUN_CPU
     98  6635  ab196087 	};
     99  9273       Ali 	static const conv_ds_msg_t ds_types_2000_2011 = {
    100  9273       Ali 	    CONV_DS_MSG_INIT(2000, types_2000_2011) };
    101  9273       Ali 
    102  6635  ab196087 	static const Msg	types_2014_2022[] = {
    103  6635  ab196087 		MSG_AUXV_AT_SUN_EXECNAME,	MSG_AUXV_AT_SUN_MMU,
    104  6635  ab196087 		MSG_AUXV_AT_SUN_LDDATA,		MSG_AUXV_AT_SUN_AUXFLAGS,
    105  6635  ab196087 		MSG_AUXV_AT_SUN_EMULATOR,	MSG_AUXV_AT_SUN_BRANDNAME,
    106  6635  ab196087 		MSG_AUXV_AT_SUN_BRAND_AUX1,	MSG_AUXV_AT_SUN_BRAND_AUX2,
    107  6635  ab196087 		MSG_AUXV_AT_SUN_BRAND_AUX3
    108  6635  ab196087 	};
    109  9273       Ali 	static const conv_ds_msg_t ds_types_2014_2022 = {
    110  9273       Ali 	    CONV_DS_MSG_INIT(2014, types_2014_2022) };
    111  6635  ab196087 
    112  9273       Ali 	static const conv_ds_t	*ds[] = {
    113  9273       Ali 		CONV_DS_ADDR(ds_types_0_22), CONV_DS_ADDR(ds_types_2000_2011),
    114  9273       Ali 		CONV_DS_ADDR(ds_types_2014_2022), NULL };
    115  6635  ab196087 
    116  9273       Ali 	return (conv_map_ds(ELFOSABI_NONE, EM_NONE, type, ds, fmt_flags,
    117  9273       Ali 	    inv_buf));
    118  6635  ab196087 }
    119  6635  ab196087 
    120  6635  ab196087 
    121  6635  ab196087 const char *
    122  6635  ab196087 conv_cnote_signal(Word sig, Conv_fmt_flags_t fmt_flags,
    123  6635  ab196087     Conv_inv_buf_t *inv_buf)
    124  6635  ab196087 {
    125  6635  ab196087 	static const Msg	sigarr[] = {
    126  6635  ab196087 		MSG_SIGHUP,		MSG_SIGINT,
    127  6635  ab196087 		MSG_SIGQUIT,		MSG_SIGILL,
    128  6635  ab196087 		MSG_SIGTRAP,		MSG_SIGABRT,
    129  6635  ab196087 		MSG_SIGEMT,		MSG_SIGFPE,
    130  6635  ab196087 		MSG_SIGKILL,		MSG_SIGBUS,
    131  6635  ab196087 		MSG_SIGSEGV,		MSG_SIGSYS,
    132  6635  ab196087 		MSG_SIGPIPE,		MSG_SIGALRM,
    133  6635  ab196087 		MSG_SIGTERM,		MSG_SIGUSR1,
    134  6635  ab196087 		MSG_SIGUSR2,		MSG_SIGCHLD,
    135  6635  ab196087 		MSG_SIGPWR,		MSG_SIGWINCH,
    136  6635  ab196087 		MSG_SIGURG,		MSG_SIGPOLL,
    137  6635  ab196087 		MSG_SIGSTOP,		MSG_SIGTSTP,
    138  6635  ab196087 		MSG_SIGCONT,		MSG_SIGTTIN,
    139  6635  ab196087 		MSG_SIGTTOU,		MSG_SIGVTALRM,
    140  6635  ab196087 		MSG_SIGPROF,		MSG_SIGXCPU,
    141  6635  ab196087 		MSG_SIGXFSZ,		MSG_SIGWAITING,
    142  6635  ab196087 		MSG_SIGLWP,		MSG_SIGFREEZE,
    143  6635  ab196087 		MSG_SIGTHAW,		MSG_SIGCANCEL,
    144  6635  ab196087 		MSG_SIGLOST,		MSG_SIGXRES,
    145  6635  ab196087 		MSG_SIGJVM1,		MSG_SIGJVM2,
    146  6635  ab196087 	};
    147  9273       Ali 	static const conv_ds_msg_t ds_sigarr = {
    148  9273       Ali 	    CONV_DS_MSG_INIT(SIGHUP, sigarr) };
    149  6635  ab196087 
    150  9273       Ali 	static const conv_ds_t	*ds[] = { CONV_DS_ADDR(ds_sigarr), NULL };
    151  6635  ab196087 
    152  9273       Ali 	return (conv_map_ds(ELFOSABI_NONE, EM_NONE, sig, ds, fmt_flags,
    153  9273       Ali 	    inv_buf));
    154  6635  ab196087 }
    155  6635  ab196087 
    156  6635  ab196087 
    157  6635  ab196087 const char *
    158  6635  ab196087 conv_cnote_fault(Word flt, Conv_fmt_flags_t fmt_flags,
    159  6635  ab196087     Conv_inv_buf_t *inv_buf)
    160  6635  ab196087 {
    161  6635  ab196087 	static const Msg	fltarr[] = {
    162  6635  ab196087 		MSG_FLTILL,		MSG_FLTPRIV,
    163  6635  ab196087 		MSG_FLTBPT,		MSG_FLTTRACE,
    164  6635  ab196087 		MSG_FLTACCESS,		MSG_FLTBOUNDS,
    165  6635  ab196087 		MSG_FLTIOVF,		MSG_FLTIZDIV,
    166  6635  ab196087 		MSG_FLTFPE,		MSG_FLTSTACK,
    167  6635  ab196087 		MSG_FLTPAGE,		MSG_FLTWATCH,
    168  6635  ab196087 		MSG_FLTCPCOVF
    169  6635  ab196087 
    170  6635  ab196087 	};
    171  9273       Ali 	static const conv_ds_msg_t ds_fltarr = {
    172  9273       Ali 	    CONV_DS_MSG_INIT(FLTILL, fltarr) };
    173  6635  ab196087 
    174  9273       Ali 	static const conv_ds_t	*ds[] = { CONV_DS_ADDR(ds_fltarr), NULL };
    175  6635  ab196087 
    176  9273       Ali 	return (conv_map_ds(ELFOSABI_NONE, EM_NONE, flt, ds, fmt_flags,
    177  9273       Ali 	    inv_buf));
    178  6635  ab196087 }
    179  6635  ab196087 
    180  6635  ab196087 
    181  6635  ab196087 const char *
    182  6635  ab196087 conv_cnote_syscall(Word sysnum, Conv_fmt_flags_t fmt_flags,
    183  6635  ab196087     Conv_inv_buf_t *inv_buf)
    184  6635  ab196087 {
    185  6635  ab196087 	static const Msg	sysnumarr[] = {
    186  6635  ab196087 		MSG_SYS_EXIT,			MSG_SYS_FORKALL,
    187  6635  ab196087 		MSG_SYS_READ,			MSG_SYS_WRITE,
    188  6635  ab196087 		MSG_SYS_OPEN,			MSG_SYS_CLOSE,
    189  6635  ab196087 		MSG_SYS_WAIT,			MSG_SYS_CREAT,
    190  6635  ab196087 		MSG_SYS_LINK,			MSG_SYS_UNLINK,
    191  6635  ab196087 		MSG_SYS_EXEC,			MSG_SYS_CHDIR,
    192  6635  ab196087 		MSG_SYS_TIME,			MSG_SYS_MKNOD,
    193  6635  ab196087 		MSG_SYS_CHMOD,			MSG_SYS_CHOWN,
    194  6635  ab196087 		MSG_SYS_BRK,			MSG_SYS_STAT,
    195  6635  ab196087 		MSG_SYS_LSEEK,			MSG_SYS_GETPID,
    196  6635  ab196087 		MSG_SYS_MOUNT,			MSG_SYS_UMOUNT,
    197  6635  ab196087 		MSG_SYS_SETUID,			MSG_SYS_GETUID,
    198  6635  ab196087 		MSG_SYS_STIME,			MSG_SYS_PCSAMPLE,
    199  6635  ab196087 		MSG_SYS_ALARM,			MSG_SYS_FSTAT,
    200  6635  ab196087 		MSG_SYS_PAUSE,			MSG_SYS_UTIME,
    201  6635  ab196087 		MSG_SYS_STTY,			MSG_SYS_GTTY,
    202  6635  ab196087 		MSG_SYS_ACCESS,			MSG_SYS_NICE,
    203  6635  ab196087 		MSG_SYS_STATFS,			MSG_SYS_SYNC,
    204  6635  ab196087 		MSG_SYS_KILL,			MSG_SYS_FSTATFS,
    205  6635  ab196087 		MSG_SYS_PGRPSYS,		MSG_SYS_UUCOPYSTR,
    206  6635  ab196087 		MSG_SYS_DUP,			MSG_SYS_PIPE,
    207  6635  ab196087 		MSG_SYS_TIMES,			MSG_SYS_PROFIL,
    208  6635  ab196087 		MSG_SYS_PLOCK,			MSG_SYS_SETGID,
    209  6635  ab196087 		MSG_SYS_GETGID,			MSG_SYS_SIGNAL,
    210  6635  ab196087 		MSG_SYS_MSGSYS,			MSG_SYS_SYSI86,
    211  6635  ab196087 		MSG_SYS_ACCT,			MSG_SYS_SHMSYS,
    212  6635  ab196087 		MSG_SYS_SEMSYS,			MSG_SYS_IOCTL,
    213  6635  ab196087 		MSG_SYS_UADMIN,			MSG_SYS_56,
    214  6635  ab196087 		MSG_SYS_UTSSYS,			MSG_SYS_FDSYNC,
    215  6635  ab196087 		MSG_SYS_EXECVE,			MSG_SYS_UMASK,
    216  6635  ab196087 		MSG_SYS_CHROOT,			MSG_SYS_FCNTL,
    217  6635  ab196087 		MSG_SYS_ULIMIT,			MSG_SYS_64,
    218  6635  ab196087 		MSG_SYS_65,			MSG_SYS_66,
    219  6635  ab196087 		MSG_SYS_67,			MSG_SYS_68,
    220  6635  ab196087 		MSG_SYS_69,			MSG_SYS_TASKSYS,
    221  6635  ab196087 		MSG_SYS_ACCTCTL,		MSG_SYS_EXACCTSYS,
    222  6635  ab196087 		MSG_SYS_GETPAGESIZES,		MSG_SYS_RCTLSYS,
    223  6635  ab196087 		MSG_SYS_SIDSYS,			MSG_SYS_FSAT,
    224  6635  ab196087 		MSG_SYS_LWP_PARK,		MSG_SYS_SENDFILEV,
    225  6635  ab196087 		MSG_SYS_RMDIR,			MSG_SYS_MKDIR,
    226  6635  ab196087 		MSG_SYS_GETDENTS,		MSG_SYS_PRIVSYS,
    227  6635  ab196087 		MSG_SYS_UCREDSYS,		MSG_SYS_SYSFS,
    228  6635  ab196087 		MSG_SYS_GETMSG,			MSG_SYS_PUTMSG,
    229  6635  ab196087 		MSG_SYS_POLL,			MSG_SYS_LSTAT,
    230  6635  ab196087 		MSG_SYS_SYMLINK,		MSG_SYS_READLINK,
    231  6635  ab196087 		MSG_SYS_SETGROUPS,		MSG_SYS_GETGROUPS,
    232  6635  ab196087 		MSG_SYS_FCHMOD,			MSG_SYS_FCHOWN,
    233  6635  ab196087 		MSG_SYS_SIGPROCMASK,		MSG_SYS_SIGSUSPEND,
    234  6635  ab196087 		MSG_SYS_SIGALTSTACK,		MSG_SYS_SIGACTION,
    235  6635  ab196087 		MSG_SYS_SIGPENDING,		MSG_SYS_CONTEXT,
    236  6635  ab196087 		MSG_SYS_EVSYS,			MSG_SYS_EVTRAPRET,
    237  6635  ab196087 		MSG_SYS_STATVFS,		MSG_SYS_FSTATVFS,
    238  6635  ab196087 		MSG_SYS_GETLOADAVG,		MSG_SYS_NFSSYS,
    239  6635  ab196087 		MSG_SYS_WAITID,			MSG_SYS_SIGSENDSYS,
    240  6635  ab196087 		MSG_SYS_HRTSYS,			MSG_SYS_110,
    241  6635  ab196087 		MSG_SYS_SIGRESEND,		MSG_SYS_PRIOCNTLSYS,
    242  6635  ab196087 		MSG_SYS_PATHCONF,		MSG_SYS_MINCORE,
    243  6635  ab196087 		MSG_SYS_MMAP,			MSG_SYS_MPROTECT,
    244  6635  ab196087 		MSG_SYS_MUNMAP,			MSG_SYS_FPATHCONF,
    245  6635  ab196087 		MSG_SYS_VFORK,			MSG_SYS_FCHDIR,
    246  6635  ab196087 		MSG_SYS_READV,			MSG_SYS_WRITEV,
    247  6635  ab196087 		MSG_SYS_XSTAT,			MSG_SYS_LXSTAT,
    248  6635  ab196087 		MSG_SYS_FXSTAT,			MSG_SYS_XMKNOD,
    249  6635  ab196087 		MSG_SYS_127,			MSG_SYS_SETRLIMIT,
    250  6635  ab196087 		MSG_SYS_GETRLIMIT,		MSG_SYS_LCHOWN,
    251  6635  ab196087 		MSG_SYS_MEMCNTL,		MSG_SYS_GETPMSG,
    252  6635  ab196087 		MSG_SYS_PUTPMSG,		MSG_SYS_RENAME,
    253  6635  ab196087 		MSG_SYS_UNAME,			MSG_SYS_SETEGID,
    254  6635  ab196087 		MSG_SYS_SYSCONFIG,		MSG_SYS_ADJTIME,
    255  6635  ab196087 		MSG_SYS_SYSTEMINFO,		MSG_SYS_SHAREFS,
    256  6635  ab196087 		MSG_SYS_SETEUID,		MSG_SYS_FORKSYS,
    257  6635  ab196087 		MSG_SYS_FORK1,			MSG_SYS_SIGTIMEDWAIT,
    258  6635  ab196087 		MSG_SYS_LWP_INFO,		MSG_SYS_YIELD,
    259  6635  ab196087 		MSG_SYS_LWP_SEMA_WAIT,		MSG_SYS_LWP_SEMA_POST,
    260  6635  ab196087 		MSG_SYS_LWP_SEMA_TRYWAIT,	MSG_SYS_LWP_DETACH,
    261  6635  ab196087 		MSG_SYS_CORECTL,		MSG_SYS_MODCTL,
    262  6635  ab196087 		MSG_SYS_FCHROOT,		MSG_SYS_UTIMES,
    263  6635  ab196087 		MSG_SYS_VHANGUP,		MSG_SYS_GETTIMEOFDAY,
    264  6635  ab196087 		MSG_SYS_GETITIMER,		MSG_SYS_SETITIMER,
    265  6635  ab196087 		MSG_SYS_LWP_CREATE,		MSG_SYS_LWP_EXIT,
    266  6635  ab196087 		MSG_SYS_LWP_SUSPEND,		MSG_SYS_LWP_CONTINUE,
    267  6635  ab196087 		MSG_SYS_LWP_KILL,		MSG_SYS_LWP_SELF,
    268  6635  ab196087 		MSG_SYS_LWP_SIGMASK,		MSG_SYS_LWP_PRIVATE,
    269  6635  ab196087 		MSG_SYS_LWP_WAIT,		MSG_SYS_LWP_MUTEX_WAKEUP,
    270  6635  ab196087 		MSG_SYS_LWP_MUTEX_LOCK,		MSG_SYS_LWP_COND_WAIT,
    271  6635  ab196087 		MSG_SYS_LWP_COND_SIGNAL,	MSG_SYS_LWP_COND_BROADCAST,
    272  6635  ab196087 		MSG_SYS_PREAD,			MSG_SYS_PWRITE,
    273  6635  ab196087 		MSG_SYS_LLSEEK,			MSG_SYS_INST_SYNC,
    274  6635  ab196087 		MSG_SYS_BRAND,			MSG_SYS_KAIO,
    275  6635  ab196087 		MSG_SYS_CPC,			MSG_SYS_LGRPSYS,
    276  6635  ab196087 		MSG_SYS_RUSAGESYS,		MSG_SYS_PORT,
    277  6635  ab196087 		MSG_SYS_POLLSYS,		MSG_SYS_LABELSYS,
    278  6635  ab196087 		MSG_SYS_ACL,			MSG_SYS_AUDITSYS,
    279  6635  ab196087 		MSG_SYS_PROCESSOR_BIND,		MSG_SYS_PROCESSOR_INFO,
    280  6635  ab196087 		MSG_SYS_P_ONLINE,		MSG_SYS_SIGQUEUE,
    281  6635  ab196087 		MSG_SYS_CLOCK_GETTIME,		MSG_SYS_CLOCK_SETTIME,
    282  6635  ab196087 		MSG_SYS_CLOCK_GETRES,		MSG_SYS_TIMER_CREATE,
    283  6635  ab196087 		MSG_SYS_TIMER_DELETE,		MSG_SYS_TIMER_SETTIME,
    284  6635  ab196087 		MSG_SYS_TIMER_GETTIME,		MSG_SYS_TIMER_GETOVERRUN,
    285  6635  ab196087 		MSG_SYS_NANOSLEEP,		MSG_SYS_FACL,
    286  6635  ab196087 		MSG_SYS_DOOR,			MSG_SYS_SETREUID,
    287  6635  ab196087 		MSG_SYS_SETREGID,		MSG_SYS_INSTALL_UTRAP,
    288  6635  ab196087 		MSG_SYS_SIGNOTIFY,		MSG_SYS_SCHEDCTL,
    289  6635  ab196087 		MSG_SYS_PSET,			MSG_SYS_SPARC_UTRAP_INSTALL,
    290  6635  ab196087 		MSG_SYS_RESOLVEPATH,		MSG_SYS_LWP_MUTEX_TIMEDLOCK,
    291  6635  ab196087 		MSG_SYS_LWP_SEMA_TIMEDWAIT,	MSG_SYS_LWP_RWLOCK_SYS,
    292  6635  ab196087 		MSG_SYS_GETDENTS64,		MSG_SYS_MMAP64,
    293  6635  ab196087 		MSG_SYS_STAT64,			MSG_SYS_LSTAT64,
    294  6635  ab196087 		MSG_SYS_FSTAT64,		MSG_SYS_STATVFS64,
    295  6635  ab196087 		MSG_SYS_FSTATVFS64,		MSG_SYS_SETRLIMIT64,
    296  6635  ab196087 		MSG_SYS_GETRLIMIT64,		MSG_SYS_PREAD64,
    297  6635  ab196087 		MSG_SYS_PWRITE64,		MSG_SYS_CREAT64,
    298  6635  ab196087 		MSG_SYS_OPEN64,			MSG_SYS_RPCSYS,
    299  6635  ab196087 		MSG_SYS_ZONE,			MSG_SYS_AUTOFSSYS,
    300  6635  ab196087 		MSG_SYS_GETCWD,			MSG_SYS_SO_SOCKET,
    301  6635  ab196087 		MSG_SYS_SO_SOCKETPAIR,		MSG_SYS_BIND,
    302  6635  ab196087 		MSG_SYS_LISTEN,			MSG_SYS_ACCEPT,
    303  6635  ab196087 		MSG_SYS_CONNECT,		MSG_SYS_SHUTDOWN,
    304  6635  ab196087 		MSG_SYS_RECV,			MSG_SYS_RECVFROM,
    305  6635  ab196087 		MSG_SYS_RECVMSG,		MSG_SYS_SEND,
    306  6635  ab196087 		MSG_SYS_SENDMSG,		MSG_SYS_SENDTO,
    307  6635  ab196087 		MSG_SYS_GETPEERNAME,		MSG_SYS_GETSOCKNAME,
    308  6635  ab196087 		MSG_SYS_GETSOCKOPT,		MSG_SYS_SETSOCKOPT,
    309  6635  ab196087 		MSG_SYS_SOCKCONFIG,		MSG_SYS_NTP_GETTIME,
    310  6635  ab196087 		MSG_SYS_NTP_ADJTIME,		MSG_SYS_LWP_MUTEX_UNLOCK,
    311  6635  ab196087 		MSG_SYS_LWP_MUTEX_TRYLOCK,	MSG_SYS_LWP_MUTEX_REGISTER,
    312  6635  ab196087 		MSG_SYS_CLADM,			MSG_SYS_UUCOPY,
    313  6635  ab196087 		MSG_SYS_UMOUNT2
    314  6635  ab196087 	};
    315  9273       Ali 	static const conv_ds_msg_t ds_sysnumarr = {
    316  9273       Ali 	    CONV_DS_MSG_INIT(1, sysnumarr) };
    317  9273       Ali 
    318  9273       Ali 	static const conv_ds_t	*ds[] = { CONV_DS_ADDR(ds_sysnumarr), NULL };
    319  6635  ab196087 
    320  6635  ab196087 	int	use_num = 0;
    321  6635  ab196087 
    322  6635  ab196087 	/*
    323  6635  ab196087 	 * Range check, and handle the unused values in the middle
    324  6635  ab196087 	 * of the range. Although the missing values have strings,
    325  6635  ab196087 	 * we still prefer to format them, because those strings are
    326  6635  ab196087 	 * decimal, and the default behavior, unless the CONV_FMT_DECIMAL
    327  6635  ab196087 	 * flag is set, is to display such things in hex.
    328  6635  ab196087 	 */
    329  6635  ab196087 	switch (sysnum) {
    330  6635  ab196087 	case 0:
    331  6635  ab196087 	case 56:
    332  6635  ab196087 	case SYS_reserved_64:
    333  6635  ab196087 	case SYS_reserved_65:
    334  6635  ab196087 	case SYS_reserved_66:
    335  6635  ab196087 	case SYS_reserved_67:
    336  6635  ab196087 	case SYS_reserved_68:
    337  6635  ab196087 	case SYS_reserved_69:
    338  6635  ab196087 	case 110:
    339  6635  ab196087 	case 127:
    340  6635  ab196087 		use_num = 1;
    341  6635  ab196087 		break;
    342  6635  ab196087 	default:
    343  6635  ab196087 		use_num = (sysnum > SYS_umount2);
    344  6635  ab196087 		break;
    345  6635  ab196087 	}
    346  6635  ab196087 	if (use_num)
    347  6635  ab196087 		return (conv_invalid_val(inv_buf, sysnum, fmt_flags));
    348  6635  ab196087 
    349  9273       Ali 	return (conv_map_ds(ELFOSABI_NONE, EM_NONE, sysnum, ds, fmt_flags,
    350  9273       Ali 	    inv_buf));
    351  6635  ab196087 }
    352  6635  ab196087 
    353  6635  ab196087 
    354  6635  ab196087 const char *
    355  6635  ab196087 conv_cnote_errno(int errno_val, Conv_fmt_flags_t fmt_flags,
    356  6635  ab196087     Conv_inv_buf_t *inv_buf)
    357  6635  ab196087 {
    358  6635  ab196087 	static const Msg	errarr_1_74[74] = {
    359  6635  ab196087 		MSG_ERRNO_EPERM,		MSG_ERRNO_ENOENT,
    360  6635  ab196087 		MSG_ERRNO_ESRCH,		MSG_ERRNO_EINTR,
    361  6635  ab196087 		MSG_ERRNO_EIO,			MSG_ERRNO_ENXIO,
    362  6635  ab196087 		MSG_ERRNO_E2BIG,		MSG_ERRNO_ENOEXEC,
    363  6635  ab196087 		MSG_ERRNO_EBADF,		MSG_ERRNO_ECHILD,
    364  6635  ab196087 		MSG_ERRNO_EAGAIN,		MSG_ERRNO_ENOMEM,
    365  6635  ab196087 		MSG_ERRNO_EACCES,		MSG_ERRNO_EFAULT,
    366  6635  ab196087 		MSG_ERRNO_ENOTBLK,		MSG_ERRNO_EBUSY,
    367  6635  ab196087 		MSG_ERRNO_EEXIST,		MSG_ERRNO_EXDEV,
    368  6635  ab196087 		MSG_ERRNO_ENODEV,		MSG_ERRNO_ENOTDIR,
    369  6635  ab196087 		MSG_ERRNO_EISDIR,		MSG_ERRNO_EINVAL,
    370  6635  ab196087 		MSG_ERRNO_ENFILE,		MSG_ERRNO_EMFILE,
    371  6635  ab196087 		MSG_ERRNO_ENOTTY,		MSG_ERRNO_ETXTBSY,
    372  6635  ab196087 		MSG_ERRNO_EFBIG,		MSG_ERRNO_ENOSPC,
    373  6635  ab196087 		MSG_ERRNO_ESPIPE,		MSG_ERRNO_EROFS,
    374  6635  ab196087 		MSG_ERRNO_EMLINK,		MSG_ERRNO_EPIPE,
    375  6635  ab196087 		MSG_ERRNO_EDOM,			MSG_ERRNO_ERANGE,
    376  6635  ab196087 		MSG_ERRNO_ENOMSG,		MSG_ERRNO_EIDRM,
    377  6635  ab196087 		MSG_ERRNO_ECHRNG,		MSG_ERRNO_EL2NSYNC,
    378  6635  ab196087 		MSG_ERRNO_EL3HLT,		MSG_ERRNO_EL3RST,
    379  6635  ab196087 		MSG_ERRNO_ELNRNG,		MSG_ERRNO_EUNATCH,
    380  6635  ab196087 		MSG_ERRNO_ENOCSI,		MSG_ERRNO_EL2HLT,
    381  6635  ab196087 		MSG_ERRNO_EDEADLK,		MSG_ERRNO_ENOLCK,
    382  6635  ab196087 		MSG_ERRNO_ECANCELED,		MSG_ERRNO_ENOTSUP,
    383  6635  ab196087 		MSG_ERRNO_EDQUOT,		MSG_ERRNO_EBADE,
    384  6635  ab196087 		MSG_ERRNO_EBADR,		MSG_ERRNO_EXFULL,
    385  6635  ab196087 		MSG_ERRNO_ENOANO,		MSG_ERRNO_EBADRQC,
    386  6635  ab196087 		MSG_ERRNO_EBADSLT,		MSG_ERRNO_EDEADLOCK,
    387  6635  ab196087 		MSG_ERRNO_EBFONT,		MSG_ERRNO_EOWNERDEAD,
    388  6635  ab196087 		MSG_ERRNO_ENOTRECOVERABLE,	MSG_ERRNO_ENOSTR,
    389  6635  ab196087 		MSG_ERRNO_ENODATA,		MSG_ERRNO_ETIME,
    390  6635  ab196087 		MSG_ERRNO_ENOSR,		MSG_ERRNO_ENONET,
    391  6635  ab196087 		MSG_ERRNO_ENOPKG,		MSG_ERRNO_EREMOTE,
    392  6635  ab196087 		MSG_ERRNO_ENOLINK,		MSG_ERRNO_EADV,
    393  6635  ab196087 		MSG_ERRNO_ESRMNT,		MSG_ERRNO_ECOMM,
    394  6635  ab196087 		MSG_ERRNO_EPROTO,		MSG_ERRNO_ELOCKUNMAPPED,
    395  6635  ab196087 		MSG_ERRNO_ENOTACTIVE,		MSG_ERRNO_EMULTIHOP
    396  6635  ab196087 	};
    397  9273       Ali 	static const conv_ds_msg_t ds_errarr_1_74 = {
    398  9273       Ali 	    CONV_DS_MSG_INIT(1, errarr_1_74) };
    399  9273       Ali 
    400  6635  ab196087 	static const Msg	errarr_77_99[23] = {
    401  6635  ab196087 		MSG_ERRNO_EBADMSG,		MSG_ERRNO_ENAMETOOLONG,
    402  6635  ab196087 		MSG_ERRNO_EOVERFLOW,		MSG_ERRNO_ENOTUNIQ,
    403  6635  ab196087 		MSG_ERRNO_EBADFD,		MSG_ERRNO_EREMCHG,
    404  6635  ab196087 		MSG_ERRNO_ELIBACC,		MSG_ERRNO_ELIBBAD,
    405  6635  ab196087 		MSG_ERRNO_ELIBSCN,		MSG_ERRNO_ELIBMAX,
    406  6635  ab196087 		MSG_ERRNO_ELIBEXEC,		MSG_ERRNO_EILSEQ,
    407  6635  ab196087 		MSG_ERRNO_ENOSYS,		MSG_ERRNO_ELOOP,
    408  6635  ab196087 		MSG_ERRNO_ERESTART,		MSG_ERRNO_ESTRPIPE,
    409  6635  ab196087 		MSG_ERRNO_ENOTEMPTY,		MSG_ERRNO_EUSERS,
    410  6635  ab196087 		MSG_ERRNO_ENOTSOCK,		MSG_ERRNO_EDESTADDRREQ,
    411  6635  ab196087 		MSG_ERRNO_EMSGSIZE,		MSG_ERRNO_EPROTOTYPE,
    412  6635  ab196087 		MSG_ERRNO_ENOPROTOOPT
    413  6635  ab196087 	};
    414  9273       Ali 	static const conv_ds_msg_t ds_errarr_77_99 = {
    415  9273       Ali 	    CONV_DS_MSG_INIT(77, errarr_77_99) };
    416  9273       Ali 
    417  6635  ab196087 	static const Msg	errarr_120_134[15] = {
    418  6635  ab196087 		MSG_ERRNO_EPROTONOSUPPORT,	MSG_ERRNO_ESOCKTNOSUPPORT,
    419  6635  ab196087 		MSG_ERRNO_EOPNOTSUPP,		MSG_ERRNO_EPFNOSUPPORT,
    420  6635  ab196087 		MSG_ERRNO_EAFNOSUPPORT,		MSG_ERRNO_EADDRINUSE,
    421  6635  ab196087 		MSG_ERRNO_EADDRNOTAVAIL,	MSG_ERRNO_ENETDOWN,
    422  6635  ab196087 		MSG_ERRNO_ENETUNREACH,		MSG_ERRNO_ENETRESET,
    423  6635  ab196087 		MSG_ERRNO_ECONNABORTED,		MSG_ERRNO_ECONNRESET,
    424  6635  ab196087 		MSG_ERRNO_ENOBUFS,		MSG_ERRNO_EISCONN,
    425  6635  ab196087 		MSG_ERRNO_ENOTCONN
    426  6635  ab196087 	};
    427  9273       Ali 	static const conv_ds_msg_t ds_errarr_120_134 = {
    428  9273       Ali 	    CONV_DS_MSG_INIT(120, errarr_120_134) };
    429  9273       Ali 
    430  6635  ab196087 	static const Msg	errarr_143_151[9] = {
    431  6635  ab196087 		MSG_ERRNO_ESHUTDOWN,		MSG_ERRNO_ETOOMANYREFS,
    432  6635  ab196087 		MSG_ERRNO_ETIMEDOUT,		MSG_ERRNO_ECONNREFUSED,
    433  6635  ab196087 		MSG_ERRNO_EHOSTDOWN,		MSG_ERRNO_EHOSTUNREACH,
    434  6635  ab196087 		MSG_ERRNO_EALREADY,		MSG_ERRNO_EINPROGRESS,
    435  6635  ab196087 		MSG_ERRNO_ESTALE
    436  6635  ab196087 	};
    437  9273       Ali 	static const conv_ds_msg_t ds_errarr_143_151 = {
    438  9273       Ali 	    CONV_DS_MSG_INIT(143, errarr_143_151) };
    439  6635  ab196087 
    440  9273       Ali 	static const conv_ds_t	*ds[] = { CONV_DS_ADDR(ds_errarr_1_74),
    441  9273       Ali 		CONV_DS_ADDR(ds_errarr_77_99), CONV_DS_ADDR(ds_errarr_120_134),
    442  9273       Ali 		CONV_DS_ADDR(ds_errarr_143_151), NULL };
    443  6635  ab196087 
    444  6635  ab196087 
    445  9273       Ali 	return (conv_map_ds(ELFOSABI_NONE, EM_NONE, errno_val, ds, fmt_flags,
    446  9273       Ali 	    inv_buf));
    447  6635  ab196087 }
    448  6635  ab196087 
    449  6635  ab196087 
    450  6635  ab196087 const char *
    451  6635  ab196087 conv_cnote_pr_dmodel(Word dmodel, Conv_fmt_flags_t fmt_flags,
    452  6635  ab196087     Conv_inv_buf_t *inv_buf)
    453  6635  ab196087 {
    454  6635  ab196087 	static const Msg	models[] = {
    455  6635  ab196087 		MSG_PR_MODEL_UNKNOWN,
    456  6635  ab196087 		MSG_PR_MODEL_ILP32,
    457  6635  ab196087 		MSG_PR_MODEL_LP64
    458  6635  ab196087 	};
    459  9273       Ali 	static const conv_ds_msg_t ds_models = {
    460  9273       Ali 	    CONV_DS_MSG_INIT(PR_MODEL_UNKNOWN, models) };
    461  9273       Ali 	static const conv_ds_t	*ds[] = { CONV_DS_ADDR(ds_models), NULL };
    462  6635  ab196087 
    463  9273       Ali 	return (conv_map_ds(ELFOSABI_NONE, EM_NONE, dmodel, ds, fmt_flags,
    464  9273       Ali 	    inv_buf));
    465  6635  ab196087 }
    466  6635  ab196087 
    467  6635  ab196087 
    468  6635  ab196087 const char *
    469  6635  ab196087 conv_cnote_pr_why(short why, Conv_fmt_flags_t fmt_flags,
    470  6635  ab196087     Conv_inv_buf_t *inv_buf)
    471  6635  ab196087 {
    472  6635  ab196087 	static const Msg	why_arr[] = {
    473  6635  ab196087 		MSG_PR_WHY_REQUESTED,
    474  6635  ab196087 		MSG_PR_WHY_SIGNALLED,
    475  6635  ab196087 		MSG_PR_WHY_SYSENTRY,
    476  6635  ab196087 		MSG_PR_WHY_SYSEXIT,
    477  6635  ab196087 		MSG_PR_WHY_JOBCONTROL,
    478  6635  ab196087 		MSG_PR_WHY_FAULTED,
    479  6635  ab196087 		MSG_PR_WHY_SUSPENDED,
    480  6635  ab196087 		MSG_PR_WHY_CHECKPOINT
    481  6635  ab196087 	};
    482  9273       Ali 	static const conv_ds_msg_t ds_why_arr = {
    483  9273       Ali 	    CONV_DS_MSG_INIT(1, why_arr) };
    484  9273       Ali 	static const conv_ds_t	*ds[] = { CONV_DS_ADDR(ds_why_arr), NULL };
    485  6635  ab196087 
    486  9273       Ali 	return (conv_map_ds(ELFOSABI_NONE, EM_NONE, why, ds, fmt_flags,
    487  9273       Ali 	    inv_buf));
    488  6635  ab196087 }
    489  6635  ab196087 
    490  6635  ab196087 
    491  6635  ab196087 const char *
    492  6635  ab196087 conv_cnote_pr_what(short why, short what, Conv_fmt_flags_t fmt_flags,
    493  6635  ab196087     Conv_inv_buf_t *inv_buf)
    494  6635  ab196087 {
    495  6635  ab196087 	/*
    496  6635  ab196087 	 * The meaning of pr_what depends on the corresponding
    497  6635  ab196087 	 * value of pr_why, as discussed in the proc(4) manpage.
    498  6635  ab196087 	 */
    499  6635  ab196087 	switch (why) {
    500  6635  ab196087 	case PR_SIGNALLED:
    501  6635  ab196087 	case PR_JOBCONTROL:
    502  6635  ab196087 		return (conv_cnote_signal(what, fmt_flags, inv_buf));
    503  6635  ab196087 	case PR_SYSENTRY:
    504  6635  ab196087 	case PR_SYSEXIT:
    505  6635  ab196087 		return (conv_cnote_syscall(what, fmt_flags, inv_buf));
    506  6635  ab196087 	case PR_FAULTED:
    507  6635  ab196087 		return (conv_cnote_fault(what, fmt_flags, inv_buf));
    508  6635  ab196087 	};
    509  6635  ab196087 
    510  6635  ab196087 	return (conv_invalid_val(inv_buf, what, fmt_flags));
    511  6635  ab196087 }
    512  6635  ab196087 
    513  6635  ab196087 
    514  6635  ab196087 /*
    515  6635  ab196087  * Return the name of the general purpose register indexed by
    516  6635  ab196087  * regno in the pr_reg array of lwpstatus_t (<sys/procfs.h>).
    517  6635  ab196087  */
    518  6635  ab196087 const char *
    519  6635  ab196087 conv_cnote_pr_regname(Half mach, int regno, Conv_fmt_flags_t fmt_flags,
    520  6635  ab196087     Conv_inv_buf_t *inv_buf)
    521  6635  ab196087 {
    522  6635  ab196087 	static const Msg	sparc_gen_reg[32] = {
    523  6635  ab196087 		MSG_REG_SPARC_G0,		MSG_REG_SPARC_G1,
    524  6635  ab196087 		MSG_REG_SPARC_G2,		MSG_REG_SPARC_G3,
    525  6635  ab196087 		MSG_REG_SPARC_G4,		MSG_REG_SPARC_G5,
    526  6635  ab196087 		MSG_REG_SPARC_G6,		MSG_REG_SPARC_G7,
    527  6635  ab196087 		MSG_REG_SPARC_O0,		MSG_REG_SPARC_O1,
    528  6635  ab196087 		MSG_REG_SPARC_O2,		MSG_REG_SPARC_O3,
    529  6635  ab196087 		MSG_REG_SPARC_O4,		MSG_REG_SPARC_O5,
    530  6635  ab196087 		MSG_REG_SPARC_O6,		MSG_REG_SPARC_O7,
    531  6635  ab196087 		MSG_REG_SPARC_L0,		MSG_REG_SPARC_L1,
    532  6635  ab196087 		MSG_REG_SPARC_L2,		MSG_REG_SPARC_L3,
    533  6635  ab196087 		MSG_REG_SPARC_L4,		MSG_REG_SPARC_L5,
    534  6635  ab196087 		MSG_REG_SPARC_L6,		MSG_REG_SPARC_L7,
    535  6635  ab196087 		MSG_REG_SPARC_I0,		MSG_REG_SPARC_I1,
    536  6635  ab196087 		MSG_REG_SPARC_I2,		MSG_REG_SPARC_I3,
    537  6635  ab196087 		MSG_REG_SPARC_I4,		MSG_REG_SPARC_I5,
    538  6635  ab196087 		MSG_REG_SPARC_I6,		MSG_REG_SPARC_I7
    539  6635  ab196087 	};
    540  9273       Ali 	static const conv_ds_msg_t ds_sparc_gen_reg = {
    541  9273       Ali 	    CONV_DS_MSG_INIT(0, sparc_gen_reg) };
    542  9273       Ali 
    543  6635  ab196087 	static const Msg	sparc_32_37_reg[6] = {
    544  6635  ab196087 		MSG_REG_SPARC_PSR,		MSG_REG_SPARC_PC,
    545  6635  ab196087 		MSG_REG_SPARC_nPC,		MSG_REG_SPARC_Y,
    546  6635  ab196087 		MSG_REG_SPARC_WIM,		MSG_REG_SPARC_TBR
    547  6635  ab196087 	};
    548  9273       Ali 	static const conv_ds_msg_t ds_sparc_32_37_reg = {
    549  9273       Ali 	    CONV_DS_MSG_INIT(32, sparc_32_37_reg) };
    550  9273       Ali 
    551  6635  ab196087 	static const Msg	sparcv9_32_37_reg[6] = {
    552  6635  ab196087 		MSG_REG_SPARC_CCR,		MSG_REG_SPARC_PC,
    553  6635  ab196087 		MSG_REG_SPARC_nPC,		MSG_REG_SPARC_Y,
    554  6635  ab196087 		MSG_REG_SPARC_ASI,		MSG_REG_SPARC_FPRS
    555  6635  ab196087 	};
    556  9273       Ali 	static const conv_ds_msg_t ds_sparcv9_32_37_reg = {
    557  9273       Ali 	    CONV_DS_MSG_INIT(32, sparcv9_32_37_reg) };
    558  9273       Ali 
    559  6635  ab196087 	static const Msg	amd64_reg[28] = {
    560  6635  ab196087 		MSG_REG_AMD64_R15,		MSG_REG_AMD64_R14,
    561  6635  ab196087 		MSG_REG_AMD64_R13,		MSG_REG_AMD64_R12,
    562  6635  ab196087 		MSG_REG_AMD64_R11,		MSG_REG_AMD64_R10,
    563  6635  ab196087 		MSG_REG_AMD64_R9,		MSG_REG_AMD64_R8,
    564  6635  ab196087 		MSG_REG_AMD64_RDI,		MSG_REG_AMD64_RSI,
    565  6635  ab196087 		MSG_REG_AMD64_RBP,		MSG_REG_AMD64_RBX,
    566  6635  ab196087 		MSG_REG_AMD64_RDX,		MSG_REG_AMD64_RCX,
    567  6635  ab196087 		MSG_REG_AMD64_RAX,		MSG_REG_AMD64_TRAPNO,
    568  6635  ab196087 		MSG_REG_AMD64_ERR,		MSG_REG_AMD64_RIP,
    569  6635  ab196087 		MSG_REG_AMD64_CS,		MSG_REG_AMD64_RFL,
    570  6635  ab196087 		MSG_REG_AMD64_RSP,		MSG_REG_AMD64_SS,
    571  6635  ab196087 		MSG_REG_AMD64_FS,		MSG_REG_AMD64_GS,
    572  6635  ab196087 		MSG_REG_AMD64_ES,		MSG_REG_AMD64_DS,
    573  6635  ab196087 		MSG_REG_AMD64_FSBASE,		MSG_REG_AMD64_GSBASE
    574  6635  ab196087 	};
    575  9273       Ali 	static const conv_ds_msg_t ds_amd64_reg = {
    576  9273       Ali 	    CONV_DS_MSG_INIT(0, amd64_reg) };
    577  9273       Ali 
    578  6635  ab196087 	static const Msg	i86_reg[19] = {
    579  9273       Ali 		MSG_REG_I86_GS,			MSG_REG_I86_FS,
    580  9273       Ali 		MSG_REG_I86_ES,			MSG_REG_I86_DS,
    581  6635  ab196087 		MSG_REG_I86_EDI,		MSG_REG_I86_ESI,
    582  6635  ab196087 		MSG_REG_I86_EBP,		MSG_REG_I86_ESP,
    583  6635  ab196087 		MSG_REG_I86_EBX,		MSG_REG_I86_EDX,
    584  6635  ab196087 		MSG_REG_I86_ECX,		MSG_REG_I86_EAX,
    585  6635  ab196087 		MSG_REG_I86_TRAPNO,		MSG_REG_I86_ERR,
    586  6635  ab196087 		MSG_REG_I86_EIP,		MSG_REG_I86_CS,
    587  6635  ab196087 		MSG_REG_I86_EFL,		MSG_REG_I86_UESP,
    588  6635  ab196087 		MSG_REG_I86_SS
    589  6635  ab196087 	};
    590  9273       Ali 	static const conv_ds_msg_t ds_i86_reg = {
    591  9273       Ali 	    CONV_DS_MSG_INIT(0, i86_reg) };
    592  9273       Ali 
    593  9273       Ali 
    594  9273       Ali 	static const conv_ds_t	*ds_sparc[] = {
    595  9273       Ali 		CONV_DS_ADDR(ds_sparc_gen_reg),
    596  9273       Ali 		CONV_DS_ADDR(ds_sparc_32_37_reg),
    597  9273       Ali 		NULL
    598  9273       Ali 	};
    599  9273       Ali 	static const conv_ds_t	*ds_sparcv9[] = {
    600  9273       Ali 		CONV_DS_ADDR(ds_sparc_gen_reg),
    601  9273       Ali 		CONV_DS_ADDR(ds_sparcv9_32_37_reg),
    602  9273       Ali 		NULL
    603  9273       Ali 	};
    604  9273       Ali 	static const conv_ds_t	*ds_amd64[] = {
    605  9273       Ali 		CONV_DS_ADDR(ds_amd64_reg), NULL };
    606  9273       Ali 	static const conv_ds_t	*ds_i86[] = {
    607  9273       Ali 		CONV_DS_ADDR(ds_i86_reg), NULL };
    608  9273       Ali 
    609  9273       Ali 	const conv_ds_t **ds;
    610  6635  ab196087 
    611  6635  ab196087 	switch (mach) {
    612  6635  ab196087 	case EM_386:
    613  9273       Ali 		ds = ds_i86;
    614  6635  ab196087 		break;
    615  6635  ab196087 
    616  6635  ab196087 	case EM_AMD64:
    617  9273       Ali 		ds = ds_amd64;
    618  6635  ab196087 		break;
    619  6635  ab196087 
    620  6635  ab196087 	case EM_SPARC:
    621  6635  ab196087 	case EM_SPARC32PLUS:
    622  9273       Ali 		ds = ds_sparc;
    623  6635  ab196087 		break;
    624  9273       Ali 
    625  6635  ab196087 	case EM_SPARCV9:
    626  9273       Ali 		ds = ds_sparcv9;
    627  6635  ab196087 		break;
    628  9273       Ali 
    629  9273       Ali 	default:
    630  9273       Ali 		return (conv_invalid_val(inv_buf, regno, fmt_flags));
    631  6635  ab196087 	}
    632  6635  ab196087 
    633  9273       Ali 	return (conv_map_ds(ELFOSABI_NONE, mach, regno, ds, fmt_flags,
    634  9273       Ali 	    inv_buf));
    635  6635  ab196087 }
    636  6635  ab196087 
    637  6635  ab196087 const char *
    638  6635  ab196087 conv_cnote_pr_stype(Word stype, Conv_fmt_flags_t fmt_flags,
    639  6635  ab196087     Conv_inv_buf_t *inv_buf)
    640  6635  ab196087 {
    641  6635  ab196087 	static const Msg	types[] = {
    642  6635  ab196087 		MSG_SOBJ_NONE,		MSG_SOBJ_MUTEX,
    643  6635  ab196087 		MSG_SOBJ_RWLOCK,	MSG_SOBJ_CV,
    644  6635  ab196087 		MSG_SOBJ_SEMA,		MSG_SOBJ_USER,
    645  6635  ab196087 		MSG_SOBJ_USER_PI,	MSG_SOBJ_SHUTTLE
    646  6635  ab196087 	};
    647  9273       Ali 	static const conv_ds_msg_t ds_types = { CONV_DS_MSG_INIT(0, types) };
    648  9273       Ali 	static const conv_ds_t	*ds[] = { CONV_DS_ADDR(ds_types), NULL };
    649  6635  ab196087 
    650  6635  ab196087 
    651  9273       Ali 	return (conv_map_ds(ELFOSABI_NONE, EM_NONE, stype, ds, fmt_flags,
    652  9273       Ali 	    inv_buf));
    653  6635  ab196087 }
    654  6635  ab196087 
    655  6635  ab196087 
    656  6635  ab196087 const char *
    657  6635  ab196087 conv_cnote_priv(int priv, Conv_fmt_flags_t fmt_flags,
    658  6635  ab196087     Conv_inv_buf_t *inv_buf)
    659  6635  ab196087 {
    660  6635  ab196087 	const char *fmt;
    661  6635  ab196087 
    662  6635  ab196087 	/*
    663  6635  ab196087 	 * The PRIV_ constants defined in <sys/priv.h> are unusual
    664  6635  ab196087 	 * in that they are negative values. The libconv code is all
    665  6635  ab196087 	 * built around the Word type, which is unsigned. Rather than
    666  6635  ab196087 	 * modify libconv for this one case, we simply handle
    667  6635  ab196087 	 * these constants differently that the usual approach,
    668  9273       Ali 	 * and stay away from conv_invalid_val() and conv_map_ds().
    669  6635  ab196087 	 */
    670  6635  ab196087 	switch (priv) {
    671  6635  ab196087 	case PRIV_ALL:
    672  6635  ab196087 		return (MSG_ORIG(MSG_PRIV_ALL));
    673  6635  ab196087 	case PRIV_MULTIPLE:
    674  6635  ab196087 		return (MSG_ORIG(MSG_PRIV_MULTIPLE));
    675  6635  ab196087 	case PRIV_NONE:
    676  6635  ab196087 		return (MSG_ORIG(MSG_PRIV_NONE));
    677  6635  ab196087 	case PRIV_ALLZONE:
    678  6635  ab196087 		return (MSG_ORIG(MSG_PRIV_ALLZONE));
    679  6635  ab196087 	case PRIV_GLOBAL:
    680  6635  ab196087 		return (MSG_ORIG(MSG_PRIV_GLOBAL));
    681  6635  ab196087 	}
    682  6635  ab196087 
    683  6635  ab196087 	fmt = (fmt_flags & CONV_FMT_DECIMAL) ?
    684  6635  ab196087 	    MSG_ORIG(MSG_FMT_INT) : MSG_ORIG(MSG_FMT_HEXINT);
    685  6635  ab196087 	(void) snprintf(inv_buf->buf, sizeof (inv_buf->buf), fmt, priv);
    686  6635  ab196087 	return (inv_buf->buf);
    687  6635  ab196087 }
    688  6635  ab196087 
    689  6635  ab196087 
    690  6635  ab196087 const char *
    691  6635  ab196087 conv_cnote_psetid(int id, Conv_fmt_flags_t fmt_flags,
    692  6635  ab196087     Conv_inv_buf_t *inv_buf)
    693  6635  ab196087 {
    694  6635  ab196087 	const char *fmt;
    695  6635  ab196087 
    696  6635  ab196087 	/*
    697  6635  ab196087 	 * The PS_ constants defined in <sys/pset.h> are unusual
    698  6635  ab196087 	 * in that they are negative values. The libconv code is all
    699  6635  ab196087 	 * built around the Word type, which is unsigned. Rather than
    700  6635  ab196087 	 * modify libconv for this one case, we simply handle
    701  6635  ab196087 	 * these constants differently that the usual approach,
    702  9273       Ali 	 * and stay away from conv_invalid_val() and conv_map_ds().
    703  6635  ab196087 	 */
    704  6635  ab196087 	switch (id) {
    705  6635  ab196087 	case PS_NONE:
    706  6635  ab196087 		return (MSG_ORIG(MSG_PS_NONE));
    707  6635  ab196087 	case PS_QUERY:
    708  6635  ab196087 		return (MSG_ORIG(MSG_PS_QUERY));
    709  6635  ab196087 	case PS_MYID:
    710  6635  ab196087 		return (MSG_ORIG(MSG_PS_MYID));
    711  6635  ab196087 	case PS_SOFT:
    712  6635  ab196087 		return (MSG_ORIG(MSG_PS_SOFT));
    713  6635  ab196087 	case PS_HARD:
    714  6635  ab196087 		return (MSG_ORIG(MSG_PS_HARD));
    715  6635  ab196087 	case PS_QUERY_TYPE:
    716  6635  ab196087 		return (MSG_ORIG(MSG_PS_QUERY_TYPE));
    717  6635  ab196087 	}
    718  6635  ab196087 
    719  6635  ab196087 	fmt = (fmt_flags & CONV_FMT_DECIMAL) ?
    720  6635  ab196087 	    MSG_ORIG(MSG_FMT_INT) : MSG_ORIG(MSG_FMT_HEXINT);
    721  6635  ab196087 	(void) snprintf(inv_buf->buf, sizeof (inv_buf->buf), fmt, id);
    722  6635  ab196087 	return (inv_buf->buf);
    723  6635  ab196087 }
    724  6635  ab196087 
    725  6635  ab196087 
    726  6635  ab196087 /*
    727  6635  ab196087  * Return a string describing the si_code field of
    728  6635  ab196087  * the siginfo_t struct.
    729  6635  ab196087  *
    730  6635  ab196087  * The meaning of si_code is dependent on both the target
    731  6635  ab196087  * machine (mach) as well as the signal (sig).
    732  6635  ab196087  */
    733  6635  ab196087 const char *
    734  6635  ab196087 conv_cnote_si_code(Half mach, int sig, int si_code,
    735  6635  ab196087     Conv_fmt_flags_t fmt_flags, Conv_inv_buf_t *inv_buf)
    736  6635  ab196087 {
    737  6635  ab196087 
    738  6635  ab196087 	/* Values of si_code for user generated signals */
    739  6635  ab196087 	static const Msg	user_arr[6] = {
    740  6635  ab196087 		MSG_SI_USER,		MSG_SI_LWP,
    741  6635  ab196087 		MSG_SI_QUEUE,		MSG_SI_TIMER,
    742  6635  ab196087 		MSG_SI_ASYNCIO,		MSG_SI_MESGQ
    743  6635  ab196087 	};
    744  9273       Ali 	static const conv_ds_msg_t ds_msg_user_arr = {
    745  9273       Ali 	    CONV_DS_MSG_INIT(0, user_arr) };
    746  9273       Ali 	static const conv_ds_t	*ds_user_arr[] = {
    747  9273       Ali 		CONV_DS_ADDR(ds_msg_user_arr), NULL };
    748  9273       Ali 
    749  6635  ab196087 
    750  6635  ab196087 	/*
    751  6635  ab196087 	 * Architecture dependent system generated signals. All
    752  6635  ab196087 	 * versions of Solaris use the same set of these values.
    753  6635  ab196087 	 */
    754  6635  ab196087 	static const Msg	trap_arr[6] = {
    755  6635  ab196087 		MSG_SI_TRAP_BRKPT,	MSG_SI_TRAP_TRACE,
    756  6635  ab196087 		MSG_SI_TRAP_RWATCH,	MSG_SI_TRAP_WWATCH,
    757  6635  ab196087 		MSG_SI_TRAP_XWATCH,	MSG_SI_TRAP_DTRACE
    758  6635  ab196087 	};
    759  9273       Ali 	static const conv_ds_msg_t ds_msg_trap_arr = {
    760  9273       Ali 	    CONV_DS_MSG_INIT(1, trap_arr) };
    761  9273       Ali 	static const conv_ds_t	*ds_trap_arr[] = {
    762  9273       Ali 		CONV_DS_ADDR(ds_msg_trap_arr), NULL };
    763  9273       Ali 
    764  6635  ab196087 	static const Msg	cld_arr[6] = {
    765  6635  ab196087 		MSG_SI_CLD_EXITED,	MSG_SI_CLD_KILLED,
    766  6635  ab196087 		MSG_SI_CLD_DUMPED,	MSG_SI_CLD_TRAPPED,
    767  6635  ab196087 		MSG_SI_CLD_STOPPED,	MSG_SI_CLD_CONTINUED
    768  6635  ab196087 	};
    769  9273       Ali 	static const conv_ds_msg_t ds_msg_cld_arr = {
    770  9273       Ali 	    CONV_DS_MSG_INIT(1, cld_arr) };
    771  9273       Ali 	static const conv_ds_t	*ds_cld_arr[] = {
    772  9273       Ali 		CONV_DS_ADDR(ds_msg_cld_arr), NULL };
    773  9273       Ali 
    774  6635  ab196087 	static const Msg	poll_arr[6] = {
    775  6635  ab196087 		MSG_SI_POLL_IN,		MSG_SI_POLL_OUT,
    776  6635  ab196087 		MSG_SI_POLL_MSG,	MSG_SI_POLL_ERR,
    777  6635  ab196087 		MSG_SI_POLL_PRI,	MSG_SI_POLL_HUP
    778  6635  ab196087 	};
    779  9273       Ali 	static const conv_ds_msg_t ds_msg_poll_arr = {
    780  9273       Ali 	    CONV_DS_MSG_INIT(1, poll_arr) };
    781  9273       Ali 	static const conv_ds_t	*ds_poll_arr[] = {
    782  9273       Ali 		CONV_DS_ADDR(ds_msg_poll_arr), NULL };
    783  6635  ab196087 
    784  6635  ab196087 	/*
    785  6635  ab196087 	 * Architecture dependent system generated signals.
    786  6635  ab196087 	 * These items (ILL, EMT, FPE, SEGV, BUS) are platform
    787  6635  ab196087 	 * dependent. Some architectures have extra codes.
    788  6635  ab196087 	 * The same name may have a different integer value.
    789  6635  ab196087 	 * Multiple arrays are used when they differ, and one
    790  6635  ab196087 	 * array when all the architectures agree.
    791  6635  ab196087 	 */
    792  6635  ab196087 
    793  6635  ab196087 	/* ILL */
    794  6635  ab196087 	static const Msg	ill_arr[8] = {
    795  6635  ab196087 		MSG_SI_ILL_ILLOPC,	MSG_SI_ILL_ILLOPN,
    796  6635  ab196087 		MSG_SI_ILL_ILLADR,	MSG_SI_ILL_ILLTRP,
    797  6635  ab196087 		MSG_SI_ILL_PRVOPC,	MSG_SI_ILL_PRVREG,
    798  6635  ab196087 		MSG_SI_ILL_COPROC,	MSG_SI_ILL_BADSTK
    799  6635  ab196087 	};
    800  9273       Ali 	static const conv_ds_msg_t ds_msg_ill_arr = {
    801  9273       Ali 	    CONV_DS_MSG_INIT(1, ill_arr) };
    802  9273       Ali 	static const conv_ds_t	*ds_ill_arr[] = {
    803  9273       Ali 		CONV_DS_ADDR(ds_msg_ill_arr), NULL };
    804  6635  ab196087 
    805  6635  ab196087 	/* EMT */
    806  6635  ab196087 	static const Msg	emt_arr_sparc[2] = {
    807  6635  ab196087 		MSG_SI_EMT_TAGOVF,	MSG_SI_EMT_CPCOVF
    808  6635  ab196087 	};
    809  9273       Ali 	static const conv_ds_msg_t ds_msg_emt_arr_sparc = {
    810  9273       Ali 	    CONV_DS_MSG_INIT(1, emt_arr_sparc) };
    811  9273       Ali 	static const conv_ds_t	*ds_emt_arr_sparc[] = {
    812  9273       Ali 		CONV_DS_ADDR(ds_msg_emt_arr_sparc), NULL };
    813  9273       Ali 
    814  6635  ab196087 	static const Msg	emt_arr_x86[1] = {
    815  6635  ab196087 		MSG_SI_EMT_CPCOVF
    816  6635  ab196087 	};
    817  9273       Ali 	static const conv_ds_msg_t ds_msg_emt_arr_x86 = {
    818  9273       Ali 	    CONV_DS_MSG_INIT(1, emt_arr_x86) };
    819  9273       Ali 	static const conv_ds_t	*ds_emt_arr_x86[] = {
    820  9273       Ali 		CONV_DS_ADDR(ds_msg_emt_arr_x86), NULL };
    821  9273       Ali 
    822  6635  ab196087 
    823  6635  ab196087 	/* FPE */
    824  6635  ab196087 	static const Msg	fpe_arr_sparc[8] = {
    825  6635  ab196087 		MSG_SI_FPE_INTDIV,	MSG_SI_FPE_INTOVF,
    826  6635  ab196087 		MSG_SI_FPE_FLTDIV,	MSG_SI_FPE_FLTOVF,
    827  6635  ab196087 		MSG_SI_FPE_FLTUND,	MSG_SI_FPE_FLTRES,
    828  6635  ab196087 		MSG_SI_FPE_FLTINV,	MSG_SI_FPE_FLTSUB
    829  6635  ab196087 	};
    830  9273       Ali 	static const conv_ds_msg_t ds_msg_fpe_arr_sparc = {
    831  9273       Ali 	    CONV_DS_MSG_INIT(1, fpe_arr_sparc) };
    832  9273       Ali 	static const conv_ds_t	*ds_fpe_arr_sparc[] = {
    833  9273       Ali 		CONV_DS_ADDR(ds_msg_fpe_arr_sparc), NULL };
    834  9273       Ali 
    835  6635  ab196087 	static const Msg	fpe_arr_x86[9] = {
    836  6635  ab196087 		MSG_SI_FPE_INTDIV,	MSG_SI_FPE_INTOVF,
    837  6635  ab196087 		MSG_SI_FPE_FLTDIV,	MSG_SI_FPE_FLTOVF,
    838  6635  ab196087 		MSG_SI_FPE_FLTUND,	MSG_SI_FPE_FLTRES,
    839  6635  ab196087 		MSG_SI_FPE_FLTINV,	MSG_SI_FPE_FLTSUB,
    840  6635  ab196087 		MSG_SI_FPE_FLTDEN
    841  6635  ab196087 	};
    842  9273       Ali 	static const conv_ds_msg_t ds_msg_fpe_arr_x86 = {
    843  9273       Ali 	    CONV_DS_MSG_INIT(1, fpe_arr_x86) };
    844  9273       Ali 	static const conv_ds_t	*ds_fpe_arr_x86[] = {
    845  9273       Ali 		CONV_DS_ADDR(ds_msg_fpe_arr_x86), NULL };
    846  6635  ab196087 
    847  6635  ab196087 	/* SEGV */
    848  6635  ab196087 	static const Msg	segv_arr[2] = {
    849  6635  ab196087 		MSG_SI_SEGV_MAPERR,	MSG_SI_SEGV_ACCERR
    850  6635  ab196087 	};
    851  9273       Ali 	static const conv_ds_msg_t ds_msg_segv_arr = {
    852  9273       Ali 	    CONV_DS_MSG_INIT(1, segv_arr) };
    853  9273       Ali 	static const conv_ds_t	*ds_segv_arr[] = {
    854  9273       Ali 		CONV_DS_ADDR(ds_msg_segv_arr), NULL };
    855  6635  ab196087 
    856  6635  ab196087 	/* BUS */
    857  6635  ab196087 	static const Msg	bus_arr[3] = {
    858  6635  ab196087 		MSG_SI_BUS_ADRALN,	MSG_SI_BUS_ADRERR,
    859  6635  ab196087 		MSG_SI_BUS_OBJERR
    860  6635  ab196087 	};
    861  9273       Ali 	static const conv_ds_msg_t ds_msg_bus_arr = {
    862  9273       Ali 	    CONV_DS_MSG_INIT(1, bus_arr) };
    863  9273       Ali 	static const conv_ds_t	*ds_bus_arr[] = {
    864  9273       Ali 		CONV_DS_ADDR(ds_msg_bus_arr), NULL };
    865  6635  ab196087 
    866  6635  ab196087 	enum { ARCH_NONE, ARCH_X86, ARCH_SPARC } arch;
    867  6635  ab196087 
    868  6635  ab196087 
    869  6635  ab196087 	/* Handle the si_code values that do not depend on the signal */
    870  6635  ab196087 	switch (si_code) {
    871  6635  ab196087 	case SI_NOINFO:
    872  6635  ab196087 		return (MSG_ORIG(MSG_SI_NOINFO));
    873  6635  ab196087 	case SI_DTRACE:
    874  6635  ab196087 		return (MSG_ORIG(MSG_SI_DTRACE));
    875  6635  ab196087 	case SI_RCTL:
    876  6635  ab196087 		return (MSG_ORIG(MSG_SI_RCTL));
    877  6635  ab196087 	default:
    878  6635  ab196087 		/* User generated signal codes are <= 0 */
    879  6635  ab196087 		if (si_code <= 0) {
    880  6635  ab196087 			int ndx = -si_code;
    881  6635  ab196087 
    882  6635  ab196087 			/*
    883  6635  ab196087 			 * If no signal was delivered, and si_code is
    884  6635  ab196087 			 * 0, return "0" rather than "SI_USER".
    885  6635  ab196087 			 */
    886  6635  ab196087 			if ((si_code == 0) && (sig == 0))
    887  6635  ab196087 				return (MSG_ORIG(MSG_GBL_ZERO));
    888  6635  ab196087 
    889  9273       Ali 			if (ndx >= ARRAY_NELTS(user_arr)) {
    890  6635  ab196087 				const char *fmt;
    891  6635  ab196087 
    892  6635  ab196087 				fmt = (fmt_flags & CONV_FMT_DECIMAL) ?
    893  6635  ab196087 				    MSG_ORIG(MSG_FMT_INT) :
    894  6635  ab196087 				    MSG_ORIG(MSG_FMT_HEXINT);
    895  6635  ab196087 
    896  6635  ab196087 				(void) snprintf(inv_buf->buf,
    897  6635  ab196087 				    sizeof (inv_buf->buf), fmt, si_code);
    898  6635  ab196087 				return (inv_buf->buf);
    899  6635  ab196087 			}
    900  9273       Ali 			return (conv_map_ds(ELFOSABI_NONE, EM_NONE, ndx,
    901  9273       Ali 			    ds_user_arr, fmt_flags, inv_buf));
    902  6635  ab196087 		}
    903  6635  ab196087 	}
    904  6635  ab196087 
    905  6635  ab196087 	/*
    906  6635  ab196087 	 * If we didn't return above, then this is a
    907  6635  ab196087 	 * system generated signal, and the meaning of si_code
    908  6635  ab196087 	 * depends on the signal that was delivered, and possibly
    909  6635  ab196087 	 * on the target architecture.
    910  6635  ab196087 	 */
    911  6635  ab196087 	switch (mach) {
    912  6635  ab196087 	case EM_386:
    913  6635  ab196087 	case EM_AMD64:
    914  6635  ab196087 		arch = ARCH_X86;
    915  6635  ab196087 		break;
    916  6635  ab196087 
    917  6635  ab196087 	case EM_SPARC:
    918  6635  ab196087 	case EM_SPARC32PLUS:
    919  6635  ab196087 	case EM_SPARCV9:
    920  6635  ab196087 		arch = ARCH_X86;
    921  6635  ab196087 		break;
    922  6635  ab196087 
    923  6635  ab196087 	default:
    924  6635  ab196087 		arch = ARCH_NONE;
    925  6635  ab196087 		break;
    926  6635  ab196087 	}
    927  6635  ab196087 
    928  6635  ab196087 	switch (sig) {
    929  6635  ab196087 	case SIGTRAP:
    930  9273       Ali 		return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
    931  9273       Ali 		    ds_trap_arr, fmt_flags, inv_buf));
    932  6635  ab196087 
    933  6635  ab196087 	case SIGCLD:
    934  9273       Ali 		return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
    935  9273       Ali 		    ds_cld_arr, fmt_flags, inv_buf));
    936  6635  ab196087 
    937  6635  ab196087 	case SIGPOLL:
    938  9273       Ali 		return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
    939  9273       Ali 		    ds_poll_arr, fmt_flags, inv_buf));
    940  6635  ab196087 
    941  6635  ab196087 	case SIGILL:
    942  9273       Ali 		return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
    943  9273       Ali 		    ds_ill_arr, fmt_flags, inv_buf));
    944  6635  ab196087 
    945  6635  ab196087 	case SIGEMT:
    946  6635  ab196087 		switch (arch) {
    947  6635  ab196087 		case ARCH_SPARC:
    948  9273       Ali 			return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
    949  9273       Ali 			    ds_emt_arr_sparc, fmt_flags, inv_buf));
    950  6635  ab196087 		case ARCH_X86:
    951  9273       Ali 			return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
    952  9273       Ali 			    ds_emt_arr_x86, fmt_flags, inv_buf));
    953  6635  ab196087 		}
    954  6635  ab196087 		break;
    955  6635  ab196087 
    956  6635  ab196087 	case SIGFPE:
    957  6635  ab196087 		switch (arch) {
    958  6635  ab196087 		case ARCH_SPARC:
    959  9273       Ali 			return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
    960  9273       Ali 			    ds_fpe_arr_sparc, fmt_flags, inv_buf));
    961  6635  ab196087 		case ARCH_X86:
    962  9273       Ali 			return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
    963  9273       Ali 			    ds_fpe_arr_x86, fmt_flags, inv_buf));
    964  6635  ab196087 		}
    965  6635  ab196087 		break;
    966  6635  ab196087 
    967  6635  ab196087 	case SIGSEGV:
    968  9273       Ali 		return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
    969  9273       Ali 		    ds_segv_arr, fmt_flags, inv_buf));
    970  6635  ab196087 
    971  6635  ab196087 	case SIGBUS:
    972  9273       Ali 		return (conv_map_ds(ELFOSABI_NONE, EM_NONE, si_code,
    973  9273       Ali 		    ds_bus_arr, fmt_flags, inv_buf));
    974  6635  ab196087 	}
    975  6635  ab196087 
    976  6635  ab196087 	/* If not recognized, format as a number */
    977  6635  ab196087 	return (conv_invalid_val(inv_buf, si_code, fmt_flags));
    978  6635  ab196087 
    979  6635  ab196087 }
    980  6635  ab196087 
    981  6635  ab196087 
    982  6635  ab196087 #define	AUXAFFLGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
    983  6635  ab196087 	MSG_AUXV_AF_SUN_SETUGID_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
    984  6635  ab196087 	MSG_AUXV_AF_SUN_HWCAPVERIFY_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
    985  6635  ab196087 	MSG_AUXV_AF_SUN_NOPLM_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
    986  6635  ab196087 	CONV_INV_BUFSIZE		+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
    987  6635  ab196087 
    988  6635  ab196087 /*
    989  6635  ab196087  * Ensure that Conv_cnote_auxv_af_buf_t is large enough:
    990  6635  ab196087  *
    991  6635  ab196087  * AUXAFFLGSZ is the real minimum size of the buffer required by
    992  6635  ab196087  * conv_cnote_auxv_af(). However, Conv_cnote_auxv_af_buf_t
    993  6635  ab196087  * uses CONV_CNOTE_AUXV_AF_BUFSIZE to set the buffer size. We do
    994  6635  ab196087  * things this way because the definition of AUXAFFLGSZ uses information
    995  6635  ab196087  * that is not available in the environment of other programs
    996  6635  ab196087  * that include the conv.h header file.
    997  6635  ab196087  */
    998  6635  ab196087 #if (CONV_CNOTE_AUXV_AF_BUFSIZE != AUXAFFLGSZ) && !defined(__lint)
    999  6635  ab196087 #define	REPORT_BUFSIZE AUXAFFLGSZ
   1000  6635  ab196087 #include "report_bufsize.h"
   1001  6635  ab196087 #error "CONV_CNOTE_AUXV_AF_BUFSIZE does not match AUXAFFLGSZ"
   1002  6635  ab196087 #endif
   1003  6635  ab196087 
   1004  6635  ab196087 const char *
   1005  6635  ab196087 conv_cnote_auxv_af(Word flags, Conv_fmt_flags_t fmt_flags,
   1006  6635  ab196087     Conv_cnote_auxv_af_buf_t *cnote_auxv_af_buf)
   1007  6635  ab196087 {
   1008  9273       Ali 	static const Val_desc vda[] = {
   1009  9273       Ali 		{ AF_SUN_SETUGID,	MSG_AUXV_AF_SUN_SETUGID },
   1010  9273       Ali 		{ AF_SUN_HWCAPVERIFY,	MSG_AUXV_AF_SUN_HWCAPVERIFY },
   1011  9273       Ali 		{ AF_SUN_NOPLM,		MSG_AUXV_AF_SUN_NOPLM },
   1012  6635  ab196087 		{ 0,			0 }
   1013  6635  ab196087 	};
   1014  6635  ab196087 	static CONV_EXPN_FIELD_ARG conv_arg = {
   1015  9273       Ali 	    NULL, sizeof (cnote_auxv_af_buf->buf) };
   1016  6635  ab196087 
   1017  6635  ab196087 	if (flags == 0)
   1018  6635  ab196087 		return (MSG_ORIG(MSG_GBL_ZERO));
   1019  6635  ab196087 
   1020  6635  ab196087 	conv_arg.buf = cnote_auxv_af_buf->buf;
   1021  6635  ab196087 	conv_arg.oflags = conv_arg.rflags = flags;
   1022  9273       Ali 	(void) conv_expn_field(&conv_arg, vda, fmt_flags);
   1023  6635  ab196087 
   1024  6635  ab196087 	return ((const char *)cnote_auxv_af_buf->buf);
   1025  6635  ab196087 }
   1026  6635  ab196087 
   1027  6635  ab196087 
   1028  6635  ab196087 #define	CCFLGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
   1029  6635  ab196087 	MSG_CC_CONTENT_STACK_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1030  6635  ab196087 	MSG_CC_CONTENT_HEAP_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1031  6635  ab196087 	MSG_CC_CONTENT_SHFILE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1032  6635  ab196087 	MSG_CC_CONTENT_SHANON_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1033  6635  ab196087 	MSG_CC_CONTENT_TEXT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1034  6635  ab196087 	MSG_CC_CONTENT_DATA_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1035  6635  ab196087 	MSG_CC_CONTENT_RODATA_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1036  6635  ab196087 	MSG_CC_CONTENT_ANON_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1037  6635  ab196087 	MSG_CC_CONTENT_SHM_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1038  6635  ab196087 	MSG_CC_CONTENT_ISM_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1039  6635  ab196087 	MSG_CC_CONTENT_DISM_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1040  6635  ab196087 	MSG_CC_CONTENT_CTF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1041  6635  ab196087 	MSG_CC_CONTENT_SYMTAB_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1042  6635  ab196087 	CONV_INV_BUFSIZE		+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
   1043  6635  ab196087 
   1044  6635  ab196087 /*
   1045  6635  ab196087  * Ensure that Conv_cnote_cc_content_buf_t is large enough:
   1046  6635  ab196087  *
   1047  6635  ab196087  * CCFLGSZ is the real minimum size of the buffer required by
   1048  6635  ab196087  * conv_cnote_cc_content(). However, Conv_cnote_cc_content_buf_t
   1049  6635  ab196087  * uses CONV_CNOTE_CC_CONTENT_BUFSIZE to set the buffer size. We do
   1050  6635  ab196087  * things this way because the definition of CCFLGSZ uses information
   1051  6635  ab196087  * that is not available in the environment of other programs
   1052  6635  ab196087  * that include the conv.h header file.
   1053  6635  ab196087  */
   1054  6635  ab196087 #if (CONV_CNOTE_CC_CONTENT_BUFSIZE != CCFLGSZ) && !defined(__lint)
   1055  6635  ab196087 #define	REPORT_BUFSIZE CCFLGSZ
   1056  6635  ab196087 #include "report_bufsize.h"
   1057  6635  ab196087 #error "CONV_CNOTE_CC_CONTENT_BUFSIZE does not match CCFLGSZ"
   1058  6635  ab196087 #endif
   1059  6635  ab196087 
   1060  6635  ab196087 const char *
   1061  6635  ab196087 conv_cnote_cc_content(Lword flags, Conv_fmt_flags_t fmt_flags,
   1062  6635  ab196087     Conv_cnote_cc_content_buf_t *cnote_cc_content_buf)
   1063  6635  ab196087 {
   1064  6635  ab196087 	/*
   1065  6635  ab196087 	 * Note: core_content_t is a 64-bit integer value, but our
   1066  6635  ab196087 	 * conv_expn_field() logic is all built around 32-bit
   1067  6635  ab196087 	 * Word values. This will probably need changing someday,
   1068  6635  ab196087 	 * but for now, we make do with the 32-bit engine. This works
   1069  6635  ab196087 	 * because the number of bits actually assigned in
   1070  6635  ab196087 	 * the core_content_t data type (<sys/corectl.h>) bits within
   1071  6635  ab196087 	 * 32-bits.
   1072  6635  ab196087 	 *
   1073  6635  ab196087 	 * The downside is that any bits set in the upper half of
   1074  6635  ab196087 	 * the flags will be ignored. At the time of this writing,
   1075  6635  ab196087 	 * that can only occur via core file corruption, which presumably
   1076  6635  ab196087 	 * would be evident in other ways.
   1077  6635  ab196087 	 */
   1078  9273       Ali 	static const Val_desc vda[] = {
   1079  9273       Ali 		{ (Word) CC_CONTENT_STACK,	MSG_CC_CONTENT_STACK },
   1080  9273       Ali 		{ (Word) CC_CONTENT_HEAP,	MSG_CC_CONTENT_HEAP },
   1081  9273       Ali 		{ (Word) CC_CONTENT_SHFILE,	MSG_CC_CONTENT_SHFILE },
   1082  9273       Ali 		{ (Word) CC_CONTENT_SHANON,	MSG_CC_CONTENT_SHANON },
   1083  9273       Ali 		{ (Word) CC_CONTENT_TEXT,	MSG_CC_CONTENT_TEXT },
   1084  9273       Ali 		{ (Word) CC_CONTENT_DATA,	MSG_CC_CONTENT_DATA },
   1085  9273       Ali 		{ (Word) CC_CONTENT_RODATA,	MSG_CC_CONTENT_RODATA },
   1086  9273       Ali 		{ (Word) CC_CONTENT_ANON,	MSG_CC_CONTENT_ANON },
   1087  9273       Ali 		{ (Word) CC_CONTENT_SHM,	MSG_CC_CONTENT_SHM },
   1088  9273       Ali 		{ (Word) CC_CONTENT_ISM,	MSG_CC_CONTENT_ISM },
   1089  9273       Ali 		{ (Word) CC_CONTENT_DISM,	MSG_CC_CONTENT_DISM },
   1090  9273       Ali 		{ (Word) CC_CONTENT_CTF,	MSG_CC_CONTENT_CTF },
   1091  9273       Ali 		{ (Word) CC_CONTENT_SYMTAB,	MSG_CC_CONTENT_SYMTAB },
   1092  6635  ab196087 		{ 0,			0 }
   1093  6635  ab196087 	};
   1094  6635  ab196087 	static CONV_EXPN_FIELD_ARG conv_arg = {
   1095  9273       Ali 	    NULL, sizeof (cnote_cc_content_buf->buf) };
   1096  6635  ab196087 
   1097  6635  ab196087 	if (flags == 0)
   1098  6635  ab196087 		return (MSG_ORIG(MSG_GBL_ZERO));
   1099  6635  ab196087 
   1100  6635  ab196087 	conv_arg.buf = cnote_cc_content_buf->buf;
   1101  6635  ab196087 	conv_arg.oflags = conv_arg.rflags = flags;
   1102  9273       Ali 	(void) conv_expn_field(&conv_arg, vda, fmt_flags);
   1103  6635  ab196087 
   1104  6635  ab196087 	return ((const char *)cnote_cc_content_buf->buf);
   1105  6635  ab196087 }
   1106  6635  ab196087 
   1107  6635  ab196087 
   1108  6635  ab196087 #define	PRFLGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
   1109  6635  ab196087 	MSG_PR_FLAGS_STOPPED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1110  6635  ab196087 	MSG_PR_FLAGS_ISTOP_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1111  6635  ab196087 	MSG_PR_FLAGS_DSTOP_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1112  6635  ab196087 	MSG_PR_FLAGS_STEP_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1113  6635  ab196087 	MSG_PR_FLAGS_ASLEEP_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1114  6635  ab196087 	MSG_PR_FLAGS_PCINVAL_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1115  6635  ab196087 	MSG_PR_FLAGS_ASLWP_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1116  6635  ab196087 	MSG_PR_FLAGS_AGENT_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1117  6635  ab196087 	MSG_PR_FLAGS_DETACH_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1118  6635  ab196087 	MSG_PR_FLAGS_DAEMON_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1119  6635  ab196087 	MSG_PR_FLAGS_IDLE_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1120  6635  ab196087 	MSG_PR_FLAGS_ISSYS_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1121  6635  ab196087 	MSG_PR_FLAGS_VFORKP_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1122  6635  ab196087 	MSG_PR_FLAGS_ORPHAN_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1123  6635  ab196087 	MSG_PR_FLAGS_NOSIGCHLD_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1124  6635  ab196087 	MSG_PR_FLAGS_WAITPID_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1125  6635  ab196087 	MSG_PR_FLAGS_FORK_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1126  6635  ab196087 	MSG_PR_FLAGS_RLC_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1127  6635  ab196087 	MSG_PR_FLAGS_KLC_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1128  6635  ab196087 	MSG_PR_FLAGS_ASYNC_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1129  6635  ab196087 	MSG_PR_FLAGS_MSACCT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1130  6635  ab196087 	MSG_PR_FLAGS_BPTADJ_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1131  6635  ab196087 	MSG_PR_FLAGS_PTRACE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1132  6635  ab196087 	MSG_PR_FLAGS_MSFORK_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1133  6635  ab196087 	CONV_INV_BUFSIZE		+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
   1134  6635  ab196087 
   1135  6635  ab196087 /*
   1136  6635  ab196087  * Ensure that Conv_cnote_pr_flags_buf_t is large enough:
   1137  6635  ab196087  *
   1138  6635  ab196087  * PRFLGSZ is the real minimum size of the buffer required by
   1139  6635  ab196087  * conv_cnote_pr_flags(). However, Conv_cnote_pr_flags_buf_t
   1140  6635  ab196087  * uses CONV_CNOTE_PR_FLAGS_BUFSIZE to set the buffer size. We do
   1141  6635  ab196087  * things this way because the definition of PRFLGSZ uses information
   1142  6635  ab196087  * that is not available in the environment of other programs
   1143  6635  ab196087  * that include the conv.h header file.
   1144  6635  ab196087  */
   1145  6635  ab196087 #if (CONV_CNOTE_PR_FLAGS_BUFSIZE != PRFLGSZ) && !defined(__lint)
   1146  6635  ab196087 #define	REPORT_BUFSIZE PRFLGSZ
   1147  6635  ab196087 #include "report_bufsize.h"
   1148  6635  ab196087 #error "CONV_CNOTE_PR_FLAGS_BUFSIZE does not match PRFLGSZ"
   1149  6635  ab196087 #endif
   1150  6635  ab196087 
   1151  6635  ab196087 const char *
   1152  6635  ab196087 conv_cnote_pr_flags(int flags, Conv_fmt_flags_t fmt_flags,
   1153  6635  ab196087     Conv_cnote_pr_flags_buf_t *cnote_pr_flags_buf)
   1154  6635  ab196087 {
   1155  9273       Ali 	static const Val_desc vda[] = {
   1156  9273       Ali 		{ PR_STOPPED, 		MSG_PR_FLAGS_STOPPED },
   1157  9273       Ali 		{ PR_ISTOP,		MSG_PR_FLAGS_ISTOP },
   1158  9273       Ali 		{ PR_DSTOP,		MSG_PR_FLAGS_DSTOP },
   1159  9273       Ali 		{ PR_STEP,		MSG_PR_FLAGS_STEP },
   1160  9273       Ali 		{ PR_ASLEEP,		MSG_PR_FLAGS_ASLEEP },
   1161  9273       Ali 		{ PR_PCINVAL,		MSG_PR_FLAGS_PCINVAL },
   1162  9273       Ali 		{ PR_ASLWP,		MSG_PR_FLAGS_ASLWP },
   1163  9273       Ali 		{ PR_AGENT,		MSG_PR_FLAGS_AGENT },
   1164  9273       Ali 		{ PR_DETACH,		MSG_PR_FLAGS_DETACH },
   1165  9273       Ali 		{ PR_DAEMON,		MSG_PR_FLAGS_DAEMON },
   1166  9273       Ali 		{ PR_IDLE,		MSG_PR_FLAGS_IDLE },
   1167  9273       Ali 		{ PR_ISSYS,		MSG_PR_FLAGS_ISSYS },
   1168  9273       Ali 		{ PR_VFORKP,		MSG_PR_FLAGS_VFORKP },
   1169  9273       Ali 		{ PR_ORPHAN,		MSG_PR_FLAGS_ORPHAN },
   1170  9273       Ali 		{ PR_NOSIGCHLD,		MSG_PR_FLAGS_NOSIGCHLD },
   1171  9273       Ali 		{ PR_WAITPID,		MSG_PR_FLAGS_WAITPID },
   1172  9273       Ali 		{ PR_FORK,		MSG_PR_FLAGS_FORK },
   1173  9273       Ali 		{ PR_RLC,		MSG_PR_FLAGS_RLC },
   1174  9273       Ali 		{ PR_KLC,		MSG_PR_FLAGS_KLC },
   1175  9273       Ali 		{ PR_ASYNC,		MSG_PR_FLAGS_ASYNC },
   1176  9273       Ali 		{ PR_MSACCT,		MSG_PR_FLAGS_MSACCT },
   1177  9273       Ali 		{ PR_BPTADJ,		MSG_PR_FLAGS_BPTADJ },
   1178  9273       Ali 		{ PR_PTRACE,		MSG_PR_FLAGS_PTRACE },
   1179  9273       Ali 		{ PR_MSFORK,		MSG_PR_FLAGS_MSFORK },
   1180  6635  ab196087 		{ 0,			0 }
   1181  6635  ab196087 	};
   1182  6635  ab196087 	static CONV_EXPN_FIELD_ARG conv_arg = {
   1183  9273       Ali 	    NULL, sizeof (cnote_pr_flags_buf->buf) };
   1184  6635  ab196087 
   1185  6635  ab196087 	if (flags == 0)
   1186  6635  ab196087 		return (MSG_ORIG(MSG_GBL_ZERO));
   1187  6635  ab196087 
   1188  6635  ab196087 	conv_arg.buf = cnote_pr_flags_buf->buf;
   1189  6635  ab196087 	conv_arg.oflags = conv_arg.rflags = flags;
   1190  9273       Ali 	(void) conv_expn_field(&conv_arg, vda, fmt_flags);
   1191  6635  ab196087 
   1192  6635  ab196087 	return ((const char *)cnote_pr_flags_buf->buf);
   1193  6635  ab196087 }
   1194  6635  ab196087 
   1195  6635  ab196087 
   1196  6635  ab196087 #define	OLDPRFLGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
   1197  6635  ab196087 	MSG_PR_FLAGS_STOPPED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1198  6635  ab196087 	MSG_PR_FLAGS_ISTOP_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1199  6635  ab196087 	MSG_PR_FLAGS_DSTOP_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1200  6635  ab196087 	MSG_PR_FLAGS_ASLEEP_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1201  6635  ab196087 	MSG_PR_FLAGS_FORK_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1202  6635  ab196087 	MSG_PR_FLAGS_RLC_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1203  6635  ab196087 	MSG_PR_FLAGS_PTRACE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1204  6635  ab196087 	MSG_PR_FLAGS_PCINVAL_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1205  6635  ab196087 	MSG_PR_FLAGS_ISSYS_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1206  6635  ab196087 	MSG_PR_FLAGS_STEP_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1207  6635  ab196087 	MSG_PR_FLAGS_KLC_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1208  6635  ab196087 	MSG_PR_FLAGS_ASYNC_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1209  6635  ab196087 	MSG_PR_FLAGS_PCOMPAT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1210  6635  ab196087 	MSG_PR_FLAGS_MSACCT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1211  6635  ab196087 	MSG_PR_FLAGS_BPTADJ_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1212  6635  ab196087 	MSG_PR_FLAGS_ASLWP_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1213  6635  ab196087 	CONV_INV_BUFSIZE		+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
   1214  6635  ab196087 
   1215  6635  ab196087 /*
   1216  6635  ab196087  * Ensure that Conv_cnote_old_pr_flags_buf_t is large enough:
   1217  6635  ab196087  *
   1218  6635  ab196087  * OLDPRFLGSZ is the real minimum size of the buffer required by
   1219  6635  ab196087  * conv_cnote_old_pr_flags(). However, Conv_cnote_old_pr_flags_buf_t
   1220  6635  ab196087  * uses CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE to set the buffer size. We do
   1221  6635  ab196087  * things this way because the definition of OLDPRFLGSZ uses information
   1222  6635  ab196087  * that is not available in the environment of other programs
   1223  6635  ab196087  * that include the conv.h header file.
   1224  6635  ab196087  */
   1225  6635  ab196087 #if (CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE != OLDPRFLGSZ) && !defined(__lint)
   1226  6635  ab196087 #define	REPORT_BUFSIZE OLDPRFLGSZ
   1227  6635  ab196087 #include "report_bufsize.h"
   1228  6635  ab196087 #error "CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE does not match OLDPRFLGSZ"
   1229  6635  ab196087 #endif
   1230  6635  ab196087 
   1231  6635  ab196087 const char *
   1232  6635  ab196087 conv_cnote_old_pr_flags(int flags, Conv_fmt_flags_t fmt_flags,
   1233  6635  ab196087     Conv_cnote_old_pr_flags_buf_t *cnote_old_pr_flags_buf)
   1234  6635  ab196087 {
   1235  6635  ab196087 	/*
   1236  6635  ab196087 	 * <sys/old_procfs.h> defines names for many of these flags
   1237  6635  ab196087 	 * that are also defined in <sys/procfs.h>, but with different
   1238  6635  ab196087 	 * values. To avoid confusion, we don't include <sys/old_procfs.h>,
   1239  6635  ab196087 	 * and specify the values directly.
   1240  6635  ab196087 	 */
   1241  9273       Ali 	static const Val_desc vda[] = {
   1242  9273       Ali 		{ 0x0001,		MSG_PR_FLAGS_STOPPED },
   1243  9273       Ali 		{ 0x0002,		MSG_PR_FLAGS_ISTOP },
   1244  9273       Ali 		{ 0x0004,		MSG_PR_FLAGS_DSTOP },
   1245  9273       Ali 		{ 0x0008,		MSG_PR_FLAGS_ASLEEP },
   1246  9273       Ali 		{ 0x0010,		MSG_PR_FLAGS_FORK },
   1247  9273       Ali 		{ 0x0020,		MSG_PR_FLAGS_RLC },
   1248  9273       Ali 		{ 0x0040,		MSG_PR_FLAGS_PTRACE },
   1249  9273       Ali 		{ 0x0080,		MSG_PR_FLAGS_PCINVAL },
   1250  9273       Ali 		{ 0x0100,		MSG_PR_FLAGS_ISSYS },
   1251  9273       Ali 		{ 0x0200,		MSG_PR_FLAGS_STEP },
   1252  9273       Ali 		{ 0x0400,		MSG_PR_FLAGS_KLC },
   1253  9273       Ali 		{ 0x0800,		MSG_PR_FLAGS_ASYNC },
   1254  9273       Ali 		{ 0x1000,		MSG_PR_FLAGS_PCOMPAT },
   1255  9273       Ali 		{ 0x2000,		MSG_PR_FLAGS_MSACCT },
   1256  9273       Ali 		{ 0x4000,		MSG_PR_FLAGS_BPTADJ },
   1257  9273       Ali 		{ 0x8000,		MSG_PR_FLAGS_ASLWP },
   1258  6635  ab196087 		{ 0,			0 }
   1259  6635  ab196087 	};
   1260  6635  ab196087 	static CONV_EXPN_FIELD_ARG conv_arg = {
   1261  9273       Ali 	    NULL, sizeof (cnote_old_pr_flags_buf->buf) };
   1262  6635  ab196087 
   1263  6635  ab196087 	if (flags == 0)
   1264  6635  ab196087 		return (MSG_ORIG(MSG_GBL_ZERO));
   1265  6635  ab196087 
   1266  6635  ab196087 	conv_arg.buf = cnote_old_pr_flags_buf->buf;
   1267  6635  ab196087 	conv_arg.oflags = conv_arg.rflags = flags;
   1268  9273       Ali 	(void) conv_expn_field(&conv_arg, vda, fmt_flags);
   1269  6635  ab196087 
   1270  6635  ab196087 	return ((const char *)cnote_old_pr_flags_buf->buf);
   1271  6635  ab196087 }
   1272  6635  ab196087 
   1273  6635  ab196087 
   1274  6635  ab196087 #define	PROCFLGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
   1275  6635  ab196087 	MSG_PROC_FLAG_SSYS_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1276  6635  ab196087 	MSG_PROC_FLAG_SMSACCT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1277  6635  ab196087 	CONV_INV_BUFSIZE		+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
   1278  6635  ab196087 
   1279  6635  ab196087 /*
   1280  6635  ab196087  * Ensure that Conv_cnote_proc_flag_buf_t is large enough:
   1281  6635  ab196087  *
   1282  6635  ab196087  * PROCFLGSZ is the real minimum size of the buffer required by
   1283  6635  ab196087  * conv_cnote_proc_flag(). However, Conv_cnote_proc_flag_buf_t
   1284  6635  ab196087  * uses CONV_CNOTE_PROC_FLAG_BUFSIZE to set the buffer size. We do
   1285  6635  ab196087  * things this way because the definition of PROCFLGSZ uses information
   1286  6635  ab196087  * that is not available in the environment of other programs
   1287  6635  ab196087  * that include the conv.h header file.
   1288  6635  ab196087  */
   1289  6635  ab196087 #if (CONV_CNOTE_PROC_FLAG_BUFSIZE != PROCFLGSZ) && !defined(__lint)
   1290  6635  ab196087 #define	REPORT_BUFSIZE PROCFLGSZ
   1291  6635  ab196087 #include "report_bufsize.h"
   1292  6635  ab196087 #error "CONV_CNOTE_PROC_FLAG_BUFSIZE does not match PROCFLGSZ"
   1293  6635  ab196087 #endif
   1294  6635  ab196087 
   1295  6635  ab196087 const char *
   1296  6635  ab196087 conv_cnote_proc_flag(int flags, Conv_fmt_flags_t fmt_flags,
   1297  6635  ab196087     Conv_cnote_proc_flag_buf_t *cnote_proc_flag_buf)
   1298  6635  ab196087 {
   1299  6635  ab196087 	/*
   1300  6635  ab196087 	 * Most of the proc flags are implementation dependant, and can
   1301  6635  ab196087 	 * change between releases. As such, we do not attempt to translate
   1302  6635  ab196087 	 * them to symbolic form, but simply report them in hex form.
   1303  6635  ab196087 	 * However, SMSACCT and SSYS are special, and their bit values
   1304  6635  ab196087 	 * are maintained between releases so they can be used in the
   1305  6635  ab196087 	 * psinfo_t.p_flag field. We therefore translate these items.
   1306  6635  ab196087 	 *
   1307  6635  ab196087 	 * See <system/proc.h>
   1308  6635  ab196087 	 *
   1309  6635  ab196087 	 * Note: We don't want to include <sys/proc.h> in this file, because
   1310  6635  ab196087 	 * it redefines 'struct list', which we have defined in sgs.h. As
   1311  6635  ab196087 	 * SMSACCT and SSYS are stable public values, we simply use
   1312  6635  ab196087 	 * their numeric value.
   1313  6635  ab196087 	 */
   1314  9273       Ali 	static const Val_desc vda[] = {
   1315  9273       Ali 		{ 0x00000001, 		MSG_PROC_FLAG_SSYS },
   1316  9273       Ali 		{ 0x02000000,		MSG_PROC_FLAG_SMSACCT },
   1317  6635  ab196087 		{ 0,			0 }
   1318  6635  ab196087 	};
   1319  6635  ab196087 	static CONV_EXPN_FIELD_ARG conv_arg = {
   1320  9273       Ali 	    NULL, sizeof (cnote_proc_flag_buf->buf) };
   1321  6635  ab196087 
   1322  6635  ab196087 	if (flags == 0)
   1323  6635  ab196087 		return (MSG_ORIG(MSG_GBL_ZERO));
   1324  6635  ab196087 
   1325  6635  ab196087 	conv_arg.buf = cnote_proc_flag_buf->buf;
   1326  6635  ab196087 	conv_arg.oflags = conv_arg.rflags = flags;
   1327  9273       Ali 	(void) conv_expn_field(&conv_arg, vda, fmt_flags);
   1328  6635  ab196087 
   1329  6635  ab196087 	return ((const char *)cnote_proc_flag_buf->buf);
   1330  6635  ab196087 }
   1331  6635  ab196087 
   1332  6635  ab196087 
   1333  6635  ab196087 #define	SAFLGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
   1334  6635  ab196087 	MSG_SA_ONSTACK_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1335  6635  ab196087 	MSG_SA_RESETHAND_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1336  6635  ab196087 	MSG_SA_RESTART_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1337  6635  ab196087 	MSG_SA_SIGINFO_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1338  6635  ab196087 	MSG_SA_NODEFER_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1339  6635  ab196087 	MSG_SA_NOCLDWAIT_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1340  6635  ab196087 	MSG_SA_NOCLDSTOP_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1341  6635  ab196087 	CONV_INV_BUFSIZE		+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
   1342  6635  ab196087 
   1343  6635  ab196087 /*
   1344  6635  ab196087  * Ensure that Conv_cnote_sa_flags_buf_t is large enough:
   1345  6635  ab196087  *
   1346  6635  ab196087  * SAFLGSZ is the real minimum size of the buffer required by
   1347  6635  ab196087  * conv_cnote_sa_flags(). However, Conv_cnote_sa_flags_buf_t
   1348  6635  ab196087  * uses CONV_CNOTE_SA_FLAGS_BUFSIZE to set the buffer size. We do
   1349  6635  ab196087  * things this way because the definition of SAFLGSZ uses information
   1350  6635  ab196087  * that is not available in the environment of other programs
   1351  6635  ab196087  * that include the conv.h header file.
   1352  6635  ab196087  */
   1353  6635  ab196087 #if (CONV_CNOTE_SA_FLAGS_BUFSIZE != SAFLGSZ) && !defined(__lint)
   1354  6635  ab196087 #define	REPORT_BUFSIZE SAFLGSZ
   1355  6635  ab196087 #include "report_bufsize.h"
   1356  6635  ab196087 #error "CONV_CNOTE_SA_FLAGS_BUFSIZE does not match SAFLGSZ"
   1357  6635  ab196087 #endif
   1358  6635  ab196087 
   1359  6635  ab196087 const char *
   1360  6635  ab196087 conv_cnote_sa_flags(int flags, Conv_fmt_flags_t fmt_flags,
   1361  6635  ab196087     Conv_cnote_sa_flags_buf_t *cnote_sa_flags_buf)
   1362  6635  ab196087 {
   1363  9273       Ali 	static const Val_desc vda[] = {
   1364  9273       Ali 		{ SA_ONSTACK,		MSG_SA_ONSTACK },
   1365  9273       Ali 		{ SA_RESETHAND,		MSG_SA_RESETHAND },
   1366  9273       Ali 		{ SA_RESTART,		MSG_SA_RESTART },
   1367  9273       Ali 		{ SA_SIGINFO,		MSG_SA_SIGINFO },
   1368  9273       Ali 		{ SA_NODEFER,		MSG_SA_NODEFER },
   1369  9273       Ali 		{ SA_NOCLDWAIT,		MSG_SA_NOCLDWAIT },
   1370  9273       Ali 		{ SA_NOCLDSTOP,		MSG_SA_NOCLDSTOP },
   1371  6635  ab196087 		{ 0,			0 }
   1372  6635  ab196087 	};
   1373  6635  ab196087 	static CONV_EXPN_FIELD_ARG conv_arg = {
   1374  9273       Ali 	    NULL, sizeof (cnote_sa_flags_buf->buf) };
   1375  6635  ab196087 
   1376  6635  ab196087 	if (flags == 0)
   1377  6635  ab196087 		return (MSG_ORIG(MSG_GBL_ZERO));
   1378  6635  ab196087 
   1379  6635  ab196087 	conv_arg.buf = cnote_sa_flags_buf->buf;
   1380  6635  ab196087 	conv_arg.oflags = conv_arg.rflags = flags;
   1381  9273       Ali 	(void) conv_expn_field(&conv_arg, vda, fmt_flags);
   1382  6635  ab196087 
   1383  6635  ab196087 	return ((const char *)cnote_sa_flags_buf->buf);
   1384  6635  ab196087 }
   1385  6635  ab196087 
   1386  6635  ab196087 
   1387  6635  ab196087 #define	SSFLGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
   1388  6635  ab196087 	MSG_SS_ONSTACK_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1389  6635  ab196087 	MSG_SS_DISABLE_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1390  6635  ab196087 	CONV_INV_BUFSIZE		+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
   1391  6635  ab196087 
   1392  6635  ab196087 /*
   1393  6635  ab196087  * Ensure that Conv_cnote_ss_flags_buf_t is large enough:
   1394  6635  ab196087  *
   1395  6635  ab196087  * SSFLGSZ is the real minimum size of the buffer required by
   1396  6635  ab196087  * conv_cnote_ss_flags(). However, Conv_cnote_ss_flags_buf_t
   1397  6635  ab196087  * uses CONV_CNOTE_SS_FLAGS_BUFSIZE to set the buffer size. We do
   1398  6635  ab196087  * things this way because the definition of SSFLGSZ uses information
   1399  6635  ab196087  * that is not available in the environment of other programs
   1400  6635  ab196087  * that include the conv.h header file.
   1401  6635  ab196087  */
   1402  6635  ab196087 #if (CONV_CNOTE_SS_FLAGS_BUFSIZE != SSFLGSZ) && !defined(__lint)
   1403  6635  ab196087 #define	REPORT_BUFSIZE SSFLGSZ
   1404  6635  ab196087 #include "report_bufsize.h"
   1405  6635  ab196087 #error "CONV_CNOTE_SS_FLAGS_BUFSIZE does not match SSFLGSZ"
   1406  6635  ab196087 #endif
   1407  6635  ab196087 
   1408  6635  ab196087 const char *
   1409  6635  ab196087 conv_cnote_ss_flags(int flags, Conv_fmt_flags_t fmt_flags,
   1410  6635  ab196087     Conv_cnote_ss_flags_buf_t *cnote_ss_flags_buf)
   1411  6635  ab196087 {
   1412  9273       Ali 	static const Val_desc vda[] = {
   1413  9273       Ali 		{ SS_ONSTACK,		MSG_SS_ONSTACK },
   1414  9273       Ali 		{ SS_DISABLE,		MSG_SS_DISABLE },
   1415  6635  ab196087 		{ 0,			0 }
   1416  6635  ab196087 	};
   1417  6635  ab196087 	static CONV_EXPN_FIELD_ARG conv_arg = {
   1418  9273       Ali 	    NULL, sizeof (cnote_ss_flags_buf->buf) };
   1419  6635  ab196087 
   1420  6635  ab196087 	if (flags == 0)
   1421  6635  ab196087 		return (MSG_ORIG(MSG_GBL_ZERO));
   1422  6635  ab196087 
   1423  6635  ab196087 	conv_arg.buf = cnote_ss_flags_buf->buf;
   1424  6635  ab196087 	conv_arg.oflags = conv_arg.rflags = flags;
   1425  9273       Ali 	(void) conv_expn_field(&conv_arg, vda, fmt_flags);
   1426  6635  ab196087 
   1427  6635  ab196087 	return ((const char *)cnote_ss_flags_buf->buf);
   1428  6635  ab196087 }
   1429  6635  ab196087 
   1430  6635  ab196087 
   1431  6635  ab196087 /*
   1432  6635  ab196087  * Solaris has a variety of types that use bitmasks to represent
   1433  6635  ab196087  * sets of things like signals (sigset_t), faults (fltset_t), and
   1434  6635  ab196087  * system calls (sysset_t). These types use arrays of unsigned 32-bit
   1435  6635  ab196087  * integers to represent the set. These are public types that
   1436  6635  ab196087  * cannot be changed, so they are generously oversized to allow
   1437  6635  ab196087  * for future growth. Hence, there are usually unused bits.
   1438  6635  ab196087  *
   1439  6635  ab196087  * conv_bitmaskset() generalizes the process of displaying these items.
   1440  6635  ab196087  */
   1441  6635  ab196087 
   1442  6635  ab196087 typedef struct {
   1443  9273       Ali 	const Val_desc	*vdp;		/* NULL, or bitmask description */
   1444  6635  ab196087 	uint32_t	unused_bits;	/* Mask of undefined bits */
   1445  6635  ab196087 } conv_bitmaskset_desc_t;
   1446  6635  ab196087 
   1447  6635  ab196087 /*
   1448  6635  ab196087  * entry:
   1449  6635  ab196087  *	n_mask - # of 32-bit masks that make up this bitmask type.
   1450  6635  ab196087  *	maskarr - Array of n_mask 32-bit mask values
   1451  6635  ab196087  *	bitmask_descarr - Array of n_mask bitmask_desc_t descriptors,
   1452  6635  ab196087  *		one for each mask, specifying the bitmask names, and
   1453  6635  ab196087  *		a mask of the bits that are not defined by the system.
   1454  6635  ab196087  *	fmt_flags - CONV_FMT_* values, used to specify formatting details.
   1455  6635  ab196087  *	conv_buf - Buffer to receive formatted results
   1456  6635  ab196087  *	conv_buf_size - Size of conv_buf, including room for NULL termination
   1457  6635  ab196087  */
   1458  6635  ab196087 static const char *
   1459  6635  ab196087 conv_bitmaskset(uint32_t *maskarr, int n_mask,
   1460  9273       Ali     const conv_bitmaskset_desc_t *bitmask_descarr, Conv_fmt_flags_t fmt_flags,
   1461  6635  ab196087     char *conv_buf, size_t conv_buf_size)
   1462  6635  ab196087 {
   1463  6635  ab196087 	CONV_EXPN_FIELD_ARG	conv_arg;
   1464  6635  ab196087 	int	i, need_sep = 0;
   1465  6635  ab196087 
   1466  6635  ab196087 	/* If every bit of every mask is 0, return 0 as the result */
   1467  6635  ab196087 	for (i = 0; i < n_mask; i++)
   1468  6635  ab196087 		if (maskarr[i] != 0)
   1469  6635  ab196087 			break;
   1470  6635  ab196087 	if (i == n_mask)
   1471  6635  ab196087 		return (MSG_ORIG(MSG_GBL_ZERO));
   1472  6635  ab196087 
   1473  6635  ab196087 	/*
   1474  6635  ab196087 	 * At least one bit is non-zero. Move through the masks
   1475  6635  ab196087 	 * and process each one.
   1476  6635  ab196087 	 */
   1477  6635  ab196087 	(void) memset(&conv_arg, 0, sizeof (conv_arg));
   1478  6635  ab196087 	conv_arg.bufsize = conv_buf_size;
   1479  6635  ab196087 	conv_arg.buf = conv_buf;
   1480  6635  ab196087 	if ((fmt_flags & CONV_FMT_NOBKT) == 0) {
   1481  6635  ab196087 		*conv_arg.buf++ = '[';
   1482  6635  ab196087 		*conv_arg.buf++ = ' ';
   1483  6635  ab196087 		conv_arg.bufsize -= 2;
   1484  6635  ab196087 	}
   1485  6635  ab196087 
   1486  6635  ab196087 	/*
   1487  6635  ab196087 	 * conv_expn_field() orders its output with the most significant
   1488  6635  ab196087 	 * bits on the left. To preserve this ordering across the
   1489  6635  ab196087 	 * subwords or our "virtual bitmask", we need to process
   1490  6635  ab196087 	 * the sub-words in the same order, from most significant down
   1491  6635  ab196087 	 * to least significant. Since unassigned bits tend to be at
   1492  6635  ab196087 	 * the MSB end of the word, we process the unused bits first.
   1493  6635  ab196087 	 *
   1494  6635  ab196087 	 * One implication of this is that the caller should not use
   1495  6635  ab196087 	 * the unassigned bits for "abandoned" bits in the middle of
   1496  6635  ab196087 	 * a used range, but should instead define the string for
   1497  6635  ab196087 	 * that bit as being the string representation of that decimal
   1498  6635  ab196087 	 * value (i.e. "65"). That will cause the bit to be properly
   1499  6635  ab196087 	 * sorted among the named bits to either side of it.
   1500  6635  ab196087 	 */
   1501  6635  ab196087 	for (i = 0; i < n_mask; i++) {
   1502  6635  ab196087 		size_t		n;
   1503  6635  ab196087 		uint32_t	mask, unused_bits;
   1504  6635  ab196087 		const int	bits_per_mask = sizeof (mask) * 8;
   1505  6635  ab196087 
   1506  6635  ab196087 		mask = maskarr[i];
   1507  6635  ab196087 		unused_bits = mask & bitmask_descarr[i].unused_bits;
   1508  6635  ab196087 		mask &= ~unused_bits;
   1509  6635  ab196087 
   1510  6635  ab196087 		if (mask != 0) {
   1511  6635  ab196087 
   1512  6635  ab196087 			conv_arg.oflags = conv_arg.rflags = mask;
   1513  6635  ab196087 			if (need_sep) {
   1514  6635  ab196087 				*conv_arg.buf++ = ' ';
   1515  6635  ab196087 				conv_arg.bufsize--;
   1516  6635  ab196087 			}
   1517  6635  ab196087 			need_sep = 1;
   1518  6635  ab196087 			(void) conv_expn_field(&conv_arg,
   1519  9273       Ali 			    bitmask_descarr[i].vdp, fmt_flags | CONV_FMT_NOBKT);
   1520  6635  ab196087 			n = strlen(conv_arg.buf);
   1521  6635  ab196087 			conv_arg.bufsize -= n;
   1522  6635  ab196087 			conv_arg.buf += n;
   1523  6635  ab196087 		}
   1524  6635  ab196087 
   1525  6635  ab196087 		if (unused_bits != 0) {
   1526  6635  ab196087 			uint32_t	bit = 0x00000001;
   1527  6635  ab196087 			int		j;
   1528  6635  ab196087 
   1529  6635  ab196087 			for (j = 1; j <= bits_per_mask; j++, bit *= 2) {
   1530  6635  ab196087 				if ((unused_bits & bit) == 0)
   1531  6635  ab196087 					continue;
   1532  6635  ab196087 
   1533  6635  ab196087 				if (need_sep) {
   1534  6635  ab196087 					*conv_arg.buf++ = ' ';
   1535  6635  ab196087 					conv_arg.bufsize--;
   1536  6635  ab196087 				}
   1537  6635  ab196087 				need_sep = 1;
   1538  6635  ab196087 				n = snprintf(conv_arg.buf, conv_arg.bufsize,
   1539  6635  ab196087 				    MSG_ORIG(MSG_FMT_WORD),
   1540  6635  ab196087 				    EC_WORD(j + (bits_per_mask * i)));
   1541  6635  ab196087 				conv_arg.buf += n;
   1542  6635  ab196087 				conv_arg.bufsize -= n;
   1543  6635  ab196087 			}
   1544  6635  ab196087 		}
   1545  6635  ab196087 	}
   1546  6635  ab196087 	if ((fmt_flags & CONV_FMT_NOBKT) == 0) {
   1547  6635  ab196087 		*conv_arg.buf++ = ' ';
   1548  6635  ab196087 		*conv_arg.buf++ = ']';
   1549  6635  ab196087 	}
   1550  6635  ab196087 	*conv_arg.buf = '\0';
   1551  6635  ab196087 
   1552  6635  ab196087 	return ((const char *) conv_buf);
   1553  6635  ab196087 }
   1554  6635  ab196087 
   1555  6635  ab196087 
   1556  6635  ab196087 #define	SIGSET_FLAGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
   1557  6635  ab196087 	/* sigset_t [0] - Signals [1 - 32] */ \
   1558  6635  ab196087 	MSG_SIGHUP_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1559  6635  ab196087 	MSG_SIGINT_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1560  6635  ab196087 	MSG_SIGQUIT_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1561  6635  ab196087 	MSG_SIGILL_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1562  6635  ab196087 	MSG_SIGTRAP_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1563  6635  ab196087 	MSG_SIGABRT_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1564  6635  ab196087 	MSG_SIGEMT_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1565  6635  ab196087 	MSG_SIGFPE_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1566  6635  ab196087 	MSG_SIGKILL_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1567  6635  ab196087 	MSG_SIGBUS_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1568  6635  ab196087 	MSG_SIGSEGV_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1569  6635  ab196087 	MSG_SIGSYS_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1570  6635  ab196087 	MSG_SIGPIPE_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1571  6635  ab196087 	MSG_SIGALRM_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1572  6635  ab196087 	MSG_SIGTERM_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1573  6635  ab196087 	MSG_SIGUSR1_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1574  6635  ab196087 	MSG_SIGUSR2_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1575  6635  ab196087 	MSG_SIGCHLD_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1576  6635  ab196087 	MSG_SIGPWR_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1577  6635  ab196087 	MSG_SIGWINCH_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1578  6635  ab196087 	MSG_SIGURG_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1579  6635  ab196087 	MSG_SIGPOLL_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1580  6635  ab196087 	MSG_SIGSTOP_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1581  6635  ab196087 	MSG_SIGTSTP_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1582  6635  ab196087 	MSG_SIGCONT_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1583  6635  ab196087 	MSG_SIGTTIN_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1584  6635  ab196087 	MSG_SIGTTOU_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1585  6635  ab196087 	MSG_SIGVTALRM_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1586  6635  ab196087 	MSG_SIGPROF_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1587  6635  ab196087 	MSG_SIGXCPU_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1588  6635  ab196087 	MSG_SIGXFSZ_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1589  6635  ab196087 	MSG_SIGWAITING_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1590  6635  ab196087 	\
   1591  6635  ab196087 	/* \
   1592  6635  ab196087 	 * sigset_t [1] - Signals [33 - 64] \
   1593  6635  ab196087 	 * There are 24 unused bits, each of which needs two \
   1594  6635  ab196087 	 * characters plus a separator. \
   1595  6635  ab196087 	 */ \
   1596  6635  ab196087 	MSG_SIGLWP_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1597  6635  ab196087 	MSG_SIGFREEZE_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1598  6635  ab196087 	MSG_SIGTHAW_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1599  6635  ab196087 	MSG_SIGCANCEL_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1600  6635  ab196087 	MSG_SIGLOST_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1601  6635  ab196087 	MSG_SIGXRES_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1602  6635  ab196087 	MSG_SIGJVM1_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1603  6635  ab196087 	MSG_SIGJVM2_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1604  6635  ab196087 	(24 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
   1605  6635  ab196087 	\
   1606  6635  ab196087 	/* \
   1607  6635  ab196087 	 * sigset_t [2] - Signals [65 - 96] \
   1608  6635  ab196087 	 * There are 32 unused bits, each of which needs two \
   1609  6635  ab196087 	 * characters plus a separator. \
   1610  6635  ab196087 	 */ \
   1611  6635  ab196087 	(32 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
   1612  6635  ab196087 	\
   1613  6635  ab196087 	/* \
   1614  6635  ab196087 	 * sigset_t [2] - Signals [97 - 128] \
   1615  6635  ab196087 	 * There are 32 unused bits. Three of these need two \
   1616  6635  ab196087 	 * characters, and 29 need 3. Each one needs a separator. \
   1617  6635  ab196087 	 */ \
   1618  6635  ab196087 	(3 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
   1619  6635  ab196087 	(29 * (3 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
   1620  6635  ab196087 	\
   1621  6635  ab196087 	CONV_INV_BUFSIZE	+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
   1622  6635  ab196087 
   1623  6635  ab196087 /*
   1624  6635  ab196087  * Ensure that Conv_cnote_sigset_buf_t is large enough:
   1625  6635  ab196087  *
   1626  6635  ab196087  * SIGSET_FLAGSZ is the real minimum size of the buffer required by
   1627  6635  ab196087  * conv_cnote_sigset(). However, Conv_cnote_sigset_buf_t
   1628  6635  ab196087  * uses CONV_CNOTE_SIGSET_BUFSIZE to set the buffer size. We do
   1629  6635  ab196087  * things this way because the definition of SIGSET_FLAGSZ uses information
   1630  6635  ab196087  * that is not available in the environment of other programs
   1631  6635  ab196087  * that include the conv.h header file.
   1632  6635  ab196087  */
   1633  6635  ab196087 #if (CONV_CNOTE_SIGSET_BUFSIZE != SIGSET_FLAGSZ) && !defined(__lint)
   1634  6635  ab196087 #define	REPORT_BUFSIZE SIGSET_FLAGSZ
   1635  6635  ab196087 #include "report_bufsize.h"
   1636  6635  ab196087 #error "CONV_CNOTE_SIGSET_BUFSIZE does not match SIGSET_FLAGSZ"
   1637  6635  ab196087 #endif
   1638  6635  ab196087 
   1639  6635  ab196087 const char *
   1640  6635  ab196087 conv_cnote_sigset(uint32_t *maskarr, int n_mask,
   1641  6635  ab196087     Conv_fmt_flags_t fmt_flags, Conv_cnote_sigset_buf_t *cnote_sigset_buf)
   1642  6635  ab196087 {
   1643  6635  ab196087 #define	N_MASK 4
   1644  6635  ab196087 
   1645  9273       Ali 	static const Val_desc vda0[] = {
   1646  9273       Ali 		{ 0x00000001,		MSG_SIGHUP_ALT },
   1647  9273       Ali 		{ 0x00000002,		MSG_SIGINT_ALT },
   1648  9273       Ali 		{ 0x00000004,		MSG_SIGQUIT_ALT },
   1649  9273       Ali 		{ 0x00000008,		MSG_SIGILL_ALT },
   1650  9273       Ali 		{ 0x00000010,		MSG_SIGTRAP_ALT },
   1651  9273       Ali 		{ 0x00000020,		MSG_SIGABRT_ALT },
   1652  9273       Ali 		{ 0x00000040,		MSG_SIGEMT_ALT },
   1653  9273       Ali 		{ 0x00000080,		MSG_SIGFPE_ALT },
   1654  9273       Ali 		{ 0x00000100,		MSG_SIGKILL_ALT },
   1655  9273       Ali 		{ 0x00000200,		MSG_SIGBUS_ALT },
   1656  9273       Ali 		{ 0x00000400,		MSG_SIGSEGV_ALT },
   1657  9273       Ali 		{ 0x00000800,		MSG_SIGSYS_ALT },
   1658  9273       Ali 		{ 0x00001000,		MSG_SIGPIPE_ALT },
   1659  9273       Ali 		{ 0x00002000,		MSG_SIGALRM_ALT },
   1660  9273       Ali 		{ 0x00004000,		MSG_SIGTERM_ALT },
   1661  9273       Ali 		{ 0x00008000,		MSG_SIGUSR1_ALT },
   1662  9273       Ali 		{ 0x00010000,		MSG_SIGUSR2_ALT },
   1663  9273       Ali 		{ 0x00020000,		MSG_SIGCHLD_ALT },
   1664  9273       Ali 		{ 0x00040000,		MSG_SIGPWR_ALT },
   1665  9273       Ali 		{ 0x00080000,		MSG_SIGWINCH_ALT },
   1666  9273       Ali 		{ 0x00100000,		MSG_SIGURG_ALT },
   1667  9273       Ali 		{ 0x00200000,		MSG_SIGPOLL_ALT },
   1668  9273       Ali 		{ 0x00400000,		MSG_SIGSTOP_ALT },
   1669  9273       Ali 		{ 0x00800000,		MSG_SIGTSTP_ALT },
   1670  9273       Ali 		{ 0x01000000,		MSG_SIGCONT_ALT },
   1671  9273       Ali 		{ 0x02000000,		MSG_SIGTTIN_ALT },
   1672  9273       Ali 		{ 0x04000000,		MSG_SIGTTOU_ALT },
   1673  9273       Ali 		{ 0x08000000,		MSG_SIGVTALRM_ALT },
   1674  9273       Ali 		{ 0x10000000,		MSG_SIGPROF_ALT },
   1675  9273       Ali 		{ 0x20000000,		MSG_SIGXCPU_ALT },
   1676  9273       Ali 		{ 0x40000000,		MSG_SIGXFSZ_ALT },
   1677  9273       Ali 		{ 0x80000000,		MSG_SIGWAITING_ALT },
   1678  6635  ab196087 		{ 0,			0 }
   1679  6635  ab196087 	};
   1680  9273       Ali 	static const Val_desc vda1[] = {
   1681  9273       Ali 		{ 0x00000001,		MSG_SIGLWP_ALT },
   1682  9273       Ali 		{ 0x00000002,		MSG_SIGFREEZE_ALT },
   1683  9273       Ali 		{ 0x00000004,		MSG_SIGTHAW_ALT },
   1684  9273       Ali 		{ 0x00000008,		MSG_SIGCANCEL_ALT },
   1685  9273       Ali 		{ 0x00000010,		MSG_SIGLOST_ALT },
   1686  9273       Ali 		{ 0x00000020,		MSG_SIGXRES_ALT },
   1687  9273       Ali 		{ 0x00000040,		MSG_SIGJVM1_ALT },
   1688  9273       Ali 		{ 0x00000080,		MSG_SIGJVM2_ALT },
   1689  6635  ab196087 		{ 0,			0 }
   1690  6635  ab196087 	};
   1691  9273       Ali 	static const conv_bitmaskset_desc_t bitmask_desc[N_MASK] = {
   1692  6635  ab196087 		{ vda0, 0 },
   1693  6635  ab196087 		{ vda1, 0xffffff00 },
   1694  6635  ab196087 		{ NULL, 0xffffffff },
   1695  6635  ab196087 		{ NULL, 0xffffffff }
   1696  6635  ab196087 	};
   1697  6635  ab196087 
   1698  6635  ab196087 	if (n_mask > N_MASK)
   1699  6635  ab196087 		n_mask = N_MASK;
   1700  6635  ab196087 	return (conv_bitmaskset(maskarr, n_mask, bitmask_desc, fmt_flags,
   1701  6635  ab196087 	    cnote_sigset_buf->buf, CONV_CNOTE_SIGSET_BUFSIZE));
   1702  6635  ab196087 
   1703  6635  ab196087 #undef N_MASK
   1704  6635  ab196087 }
   1705  6635  ab196087 
   1706  6635  ab196087 
   1707  6635  ab196087 #define	FLTSET_FLAGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
   1708  6635  ab196087 	/* \
   1709  6635  ab196087 	 * fltset_t[0] - Faults [1 - 32] \
   1710  6635  ab196087 	 * There are 19 unused bits, each of which needs two \
   1711  6635  ab196087 	 * characters plus a separator. \
   1712  6635  ab196087 	 */ \
   1713  6635  ab196087 	MSG_FLTILL_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1714  6635  ab196087 	MSG_FLTPRIV_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1715  6635  ab196087 	MSG_FLTBPT_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1716  6635  ab196087 	MSG_FLTTRACE_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1717  6635  ab196087 	MSG_FLTACCESS_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1718  6635  ab196087 	MSG_FLTBOUNDS_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1719  6635  ab196087 	MSG_FLTIOVF_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1720  6635  ab196087 	MSG_FLTIZDIV_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1721  6635  ab196087 	MSG_FLTFPE_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1722  6635  ab196087 	MSG_FLTSTACK_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1723  6635  ab196087 	MSG_FLTPAGE_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1724  6635  ab196087 	MSG_FLTWATCH_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1725  6635  ab196087 	MSG_FLTCPCOVF_ALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
   1726  6635  ab196087 	(19 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
   1727  6635  ab196087 	/* \
   1728  6635  ab196087 	 * fltset_t [1] - Faults [33 - 64] \
   1729  6635  ab196087 	 * There are 32 unused bits, each of which needs two \
   1730  6635  ab196087 	 * characters plus a separator. \
   1731  6635  ab196087 	 */ \
   1732  6635  ab196087 	(32 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
   1733  6635  ab196087 	/* \
   1734  6635  ab196087 	 * fltset_t [2] - Faults [65 - 96] \
   1735  6635  ab196087 	 * There are 32 unused bits, each of which needs two \
   1736  6635  ab196087 	 * characters plus a separator. \
   1737  6635  ab196087 	 */ \
   1738  6635  ab196087 	(32 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
   1739  6635  ab196087 	/* \
   1740  6635  ab196087 	 * fltset_t [3] - Faults [97 - 128] \
   1741  6635  ab196087 	 * There are 32 unused bits. Three of these need two \
   1742  6635  ab196087 	 * characters, and 29 need 3. Each one needs a separator. \
   1743  6635  ab196087 	 */ \
   1744  6635  ab196087 	(3 * (2 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
   1745  6635  ab196087 	(29 * (3 + CONV_EXPN_FIELD_DEF_SEP_SIZE)) + \
   1746  6635  ab196087 	\
   1747  6635  ab196087 	CONV_INV_BUFSIZE	+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
   1748  6635  ab196087 
   1749  6635  ab196087 /*
   1750  6635  ab196087  * Ensure that Conv_cnote_fltset_buf_t is large enough:
   1751  6635  ab196087  *
   1752  6635  ab196087  * FLTSET_FLAGSZ is the real minimum size of the buffer required by
   1753  6635  ab196087  * conv_cnote_fltset(). However, Conv_cnote_fltset_buf_t
   1754  6635  ab196087  * uses CONV_CNOTE_FLTSET_BUFSIZE to set the buffer size. We do
   1755  6635  ab196087  * things this way because the definition of FLTSET_FLAGSZ uses information
   1756  6635  ab196087  * that is not available in the environment of other programs
   1757  6635  ab196087  * that include the conv.h header file.
   1758  6635  ab196087  */
   1759  6635  ab196087 #if (CONV_CNOTE_FLTSET_BUFSIZE != FLTSET_FLAGSZ) && !defined(__lint)
   1760  6635  ab196087 #define	REPORT_BUFSIZE FLTSET_FLAGSZ
   1761  6635  ab196087 #include "report_bufsize.h"
   1762  6635  ab196087 #error "CONV_CNOTE_FLTSET_BUFSIZE does not match FLTSET_FLAGSZ"
   1763  6635  ab196087 #endif
   1764  6635  ab196087 
   1765  6635  ab196087 const char *
   1766  6635  ab196087 conv_cnote_fltset(uint32_t *maskarr, int n_mask,
   1767  6635  ab196087     Conv_fmt_flags_t fmt_flags, Conv_cnote_fltset_buf_t *cnote_fltset_buf)
   1768  6635  ab196087 {
   1769  6635  ab196087 #define	N_MASK 4
   1770  6635  ab196087 
   1771  9273       Ali 	static const Val_desc vda0[] = {
   1772  9273       Ali 		{ 0x00000001,		MSG_FLTILL_ALT },
   1773  9273       Ali 		{ 0x00000002,		MSG_FLTPRIV_ALT },
   1774  9273       Ali 		{ 0x00000004,		MSG_FLTBPT_ALT },
   1775  9273       Ali 		{ 0x00000008,		MSG_FLTTRACE_ALT },
   1776  9273       Ali 		{ 0x00000010,		MSG_FLTACCESS_ALT },
   1777  9273       Ali 		{ 0x00000020,		MSG_FLTBOUNDS_ALT },
   1778  9273       Ali 		{ 0x00000040,		MSG_FLTIOVF_ALT },
   1779  9273       Ali 		{ 0x00000080,		MSG_FLTIZDIV_ALT },
   1780  9273       Ali 		{ 0x00000100,		MSG_FLTFPE_ALT },
   1781  9273       Ali 		{ 0x00000200,		MSG_FLTSTACK_ALT },
   1782  9273       Ali 		{ 0x00000400,		MSG_FLTPAGE_ALT },
   1783  9273       Ali 		{ 0x00000800,		MSG_FLTWATCH_ALT },
   1784  9273       Ali 		{ 0x00001000,		MSG_FLTCPCOVF_ALT },
   1785  6635  ab196087 		{ 0,			0 }
   1786  6635  ab196087 	};
   1787  9273       Ali 	static const conv_bitmaskset_desc_t bitmask_desc[N_MASK] = {
   1788  6635  ab196087 		{ vda0, 0xffffe000 },
   1789  6635  ab196087 		{ NULL, 0xffffffff },
   1790  6635  ab196087 		{ NULL, 0xffffffff },
   1791  6635  ab196087 		{ NULL, 0xffffffff }
   1792  6635  ab196087 	};
   1793  6635  ab196087 
   1794  6635  ab196087 	if (n_mask > N_MASK)
   1795  6635  ab196087 		n_mask = N_MASK;
   1796  6635  ab196087 	return (conv_bitmaskset(maskarr, n_mask, bitmask_desc, fmt_flags,
   1797  6635  ab196087 	    cnote_fltset_buf->buf, CONV_CNOTE_FLTSET_BUFSIZE));
   1798  6635  ab196087 
   1799  6635  ab196087 #undef N_MASK
   1800  6635  ab196087 }
   1801  6635  ab196087 
   1802  6635  ab196087 
   1803  6635  ab196087 
   1804  6635  ab196087 #define	SYSSET_FLAGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
   1805  6635  ab196087 	(512 * CONV_EXPN_FIELD_DEF_SEP_SIZE) + \
   1806  6635  ab196087 	\
   1807  6635  ab196087 	/* sysset_t[0] - System Calls [1 - 32] */ \
   1808  6635  ab196087 	MSG_SYS_EXIT_ALT_SIZE			/* 1 */ + \
   1809  6635  ab196087 	MSG_SYS_FORKALL_ALT_SIZE		/* 2 */ + \
   1810  6635  ab196087 	MSG_SYS_READ_ALT_SIZE			/* 3 */ + \
   1811  6635  ab196087 	MSG_SYS_WRITE_ALT_SIZE			/* 4 */ + \
   1812  6635  ab196087 	MSG_SYS_OPEN_ALT_SIZE			/* 5 */ + \
   1813  6635  ab196087 	MSG_SYS_CLOSE_ALT_SIZE			/* 6 */ + \
   1814  6635  ab196087 	MSG_SYS_WAIT_ALT_SIZE			/* 7 */ + \
   1815  6635  ab196087 	MSG_SYS_CREAT_ALT_SIZE			/* 8 */ + \
   1816  6635  ab196087 	MSG_SYS_LINK_ALT_SIZE			/* 9 */ + \
   1817  6635  ab196087 	MSG_SYS_UNLINK_ALT_SIZE			/* 10 */ + \
   1818  6635  ab196087 	MSG_SYS_EXEC_ALT_SIZE			/* 11 */ + \
   1819  6635  ab196087 	MSG_SYS_CHDIR_ALT_SIZE			/* 12 */ + \
   1820  6635  ab196087 	MSG_SYS_TIME_ALT_SIZE			/* 13 */ + \
   1821  6635  ab196087 	MSG_SYS_MKNOD_ALT_SIZE			/* 14 */ + \
   1822  6635  ab196087 	MSG_SYS_CHMOD_ALT_SIZE			/* 15 */ + \
   1823  6635  ab196087 	MSG_SYS_CHOWN_ALT_SIZE			/* 16 */ + \
   1824  6635  ab196087 	MSG_SYS_BRK_ALT_SIZE			/* 17 */ + \
   1825  6635  ab196087 	MSG_SYS_STAT_ALT_SIZE			/* 18 */ + \
   1826  6635  ab196087 	MSG_SYS_LSEEK_ALT_SIZE			/* 19 */ + \
   1827  6635  ab196087 	MSG_SYS_GETPID_ALT_SIZE			/* 20 */ + \
   1828  6635  ab196087 	MSG_SYS_MOUNT_ALT_SIZE			/* 21 */ + \
   1829  6635  ab196087 	MSG_SYS_UMOUNT_ALT_SIZE			/* 22 */ + \
   1830  6635  ab196087 	MSG_SYS_SETUID_ALT_SIZE			/* 23 */ + \
   1831  6635  ab196087 	MSG_SYS_GETUID_ALT_SIZE			/* 24 */ + \
   1832  6635  ab196087 	MSG_SYS_STIME_ALT_SIZE			/* 25 */ + \
   1833  6635  ab196087 	MSG_SYS_PCSAMPLE_ALT_SIZE		/* 26 */ + \
   1834  6635  ab196087 	MSG_SYS_ALARM_ALT_SIZE			/* 27 */ + \
   1835  6635  ab196087 	MSG_SYS_FSTAT_ALT_SIZE			/* 28 */ + \
   1836  6635  ab196087 	MSG_SYS_PAUSE_ALT_SIZE			/* 29 */ + \
   1837  6635  ab196087 	MSG_SYS_UTIME_ALT_SIZE			/* 30 */ + \
   1838  6635  ab196087 	MSG_SYS_STTY_ALT_SIZE			/* 31 */ + \
   1839  6635  ab196087 	MSG_SYS_GTTY_ALT_SIZE			/* 32 */ + \
   1840  6635  ab196087 	\
   1841  6635  ab196087 	/* sysset_t[1] - System Calls [33 - 64] */ \
   1842  6635  ab196087 	MSG_SYS_ACCESS_ALT_SIZE			/* 33 */ + \
   1843  6635  ab196087 	MSG_SYS_NICE_ALT_SIZE			/* 34 */ + \
   1844  6635  ab196087 	MSG_SYS_STATFS_ALT_SIZE			/* 35 */ + \
   1845  6635  ab196087 	MSG_SYS_SYNC_ALT_SIZE			/* 36 */ + \
   1846  6635  ab196087 	MSG_SYS_KILL_ALT_SIZE			/* 37 */ + \
   1847  6635  ab196087 	MSG_SYS_FSTATFS_ALT_SIZE		/* 38 */ + \
   1848  6635  ab196087 	MSG_SYS_PGRPSYS_ALT_SIZE		/* 39 */ + \
   1849  6635  ab196087 	MSG_SYS_UUCOPYSTR_ALT_SIZE		/* 40 */ + \
   1850  6635  ab196087 	MSG_SYS_DUP_ALT_SIZE			/* 41 */ + \
   1851  6635  ab196087 	MSG_SYS_PIPE_ALT_SIZE			/* 42 */ + \
   1852  6635  ab196087 	MSG_SYS_TIMES_ALT_SIZE			/* 43 */ + \
   1853  6635  ab196087 	MSG_SYS_PROFIL_ALT_SIZE			/* 44 */ + \
   1854  6635  ab196087 	MSG_SYS_PLOCK_ALT_SIZE			/* 45 */ + \
   1855  6635  ab196087 	MSG_SYS_SETGID_ALT_SIZE			/* 46 */ + \
   1856  6635  ab196087 	MSG_SYS_GETGID_ALT_SIZE			/* 47 */ + \
   1857  6635  ab196087 	MSG_SYS_SIGNAL_ALT_SIZE			/* 48 */ + \
   1858  6635  ab196087 	MSG_SYS_MSGSYS_ALT_SIZE			/* 49 */ + \
   1859  6635  ab196087 	MSG_SYS_SYSI86_ALT_SIZE			/* 50 */ + \
   1860  6635  ab196087 	MSG_SYS_ACCT_ALT_SIZE			/* 51 */ + \
   1861  6635  ab196087 	MSG_SYS_SHMSYS_ALT_SIZE			/* 52 */ + \
   1862  6635  ab196087 	MSG_SYS_SEMSYS_ALT_SIZE			/* 53 */ + \
   1863  6635  ab196087 	MSG_SYS_IOCTL_ALT_SIZE			/* 54 */ + \
   1864  6635  ab196087 	MSG_SYS_UADMIN_ALT_SIZE			/* 55 */ + \
   1865  6635  ab196087 	MSG_SYS_56_SIZE				/* 56 (unused) */ + \
   1866  6635  ab196087 	MSG_SYS_UTSSYS_ALT_SIZE			/* 57 */ + \
   1867  6635  ab196087 	MSG_SYS_FDSYNC_ALT_SIZE			/* 58 */ + \
   1868  6635  ab196087 	MSG_SYS_EXECVE_ALT_SIZE			/* 59 */ + \
   1869  6635  ab196087 	MSG_SYS_UMASK_ALT_SIZE			/* 60 */ + \
   1870  6635  ab196087 	MSG_SYS_CHROOT_ALT_SIZE			/* 61 */ + \
   1871  6635  ab196087 	MSG_SYS_FCNTL_ALT_SIZE			/* 62 */ + \
   1872  6635  ab196087 	MSG_SYS_ULIMIT_ALT_SIZE			/* 63 */ + \
   1873  6635  ab196087 	MSG_SYS_64_SIZE				/* 64 (reserved) */ + \
   1874  6635  ab196087 	\
   1875  6635  ab196087 	/* sysset_t[2] - System Calls [65 - 96] */ \
   1876  6635  ab196087 	MSG_SYS_65_SIZE				/* 65 (reserved) */ + \
   1877  6635  ab196087 	MSG_SYS_66_SIZE				/* 66 (reserved) */ + \
   1878  6635  ab196087 	MSG_SYS_67_SIZE				/* 67 (reserved) */ + \
   1879  6635  ab196087 	MSG_SYS_68_SIZE				/* 68 (reserved) */ + \
   1880  6635  ab196087 	MSG_SYS_69_SIZE				/* 69 (reserved) */ + \
   1881  6635  ab196087 	MSG_SYS_TASKSYS_ALT_SIZE		/* 70 */ + \
   1882  6635  ab196087 	MSG_SYS_ACCTCTL_ALT_SIZE		/* 71 */ + \
   1883  6635  ab196087 	MSG_SYS_EXACCTSYS_ALT_SIZE		/* 72 */ + \
   1884  6635  ab196087 	MSG_SYS_GETPAGESIZES_ALT_SIZE		/* 73 */ + \
   1885  6635  ab196087 	MSG_SYS_RCTLSYS_ALT_SIZE		/* 74 */ + \
   1886  6635  ab196087 	MSG_SYS_SIDSYS_ALT_SIZE			/* 75 */ + \
   1887  6635  ab196087 	MSG_SYS_FSAT_ALT_SIZE			/* 76 */ + \
   1888  6635  ab196087 	MSG_SYS_LWP_PARK_ALT_SIZE		/* 77 */ + \
   1889  6635  ab196087 	MSG_SYS_SENDFILEV_ALT_SIZE		/* 78 */ + \
   1890  6635  ab196087 	MSG_SYS_RMDIR_ALT_SIZE			/* 79 */ + \
   1891  6635  ab196087 	MSG_SYS_MKDIR_ALT_SIZE			/* 80 */ + \
   1892  6635  ab196087 	MSG_SYS_GETDENTS_ALT_SIZE		/* 81 */ + \
   1893  6635  ab196087 	MSG_SYS_PRIVSYS_ALT_SIZE		/* 82 */ + \
   1894  6635  ab196087 	MSG_SYS_UCREDSYS_ALT_SIZE		/* 83 */ + \
   1895  6635  ab196087 	MSG_SYS_SYSFS_ALT_SIZE			/* 84 */ + \
   1896  6635  ab196087 	MSG_SYS_GETMSG_ALT_SIZE			/* 85 */ + \
   1897  6635  ab196087 	MSG_SYS_PUTMSG_ALT_SIZE			/* 86 */ + \
   1898  6635  ab196087 	MSG_SYS_POLL_ALT_SIZE			/* 87 */ + \
   1899  6635  ab196087 	MSG_SYS_LSTAT_ALT_SIZE			/* 88 */ + \
   1900  6635  ab196087 	MSG_SYS_SYMLINK_ALT_SIZE		/* 89 */ + \
   1901  6635  ab196087 	MSG_SYS_READLINK_ALT_SIZE		/* 90 */ + \
   1902  6635  ab196087 	MSG_SYS_SETGROUPS_ALT_SIZE		/* 91 */ + \
   1903  6635  ab196087 	MSG_SYS_GETGROUPS_ALT_SIZE		/* 92 */ + \
   1904  6635  ab196087 	MSG_SYS_FCHMOD_ALT_SIZE			/* 93 */ + \
   1905  6635  ab196087 	MSG_SYS_FCHOWN_ALT_SIZE			/* 94 */ + \
   1906  6635  ab196087 	MSG_SYS_SIGPROCMASK_ALT_SIZE		/* 95 */ + \
   1907  6635  ab196087 	MSG_SYS_SIGSUSPEND_ALT_SIZE		/* 96 */ + \
   1908  6635  ab196087 	\
   1909  6635  ab196087 	/* sysset_t[3] - System Calls [97 - 128] */ \
   1910  6635  ab196087 	MSG_SYS_SIGALTSTACK_ALT_SIZE		/* 97 */ + \
   1911  6635  ab196087 	MSG_SYS_SIGACTION_ALT_SIZE		/* 98 */ + \
   1912  6635  ab196087 	MSG_SYS_SIGPENDING_ALT_SIZE		/* 99 */ + \
   1913  6635  ab196087 	MSG_SYS_CONTEXT_ALT_SIZE		/* 100 */ + \
   1914  6635  ab196087 	MSG_SYS_EVSYS_ALT_SIZE			/* 101 */ + \
   1915  6635  ab196087 	MSG_SYS_EVTRAPRET_ALT_SIZE		/* 102 */ + \
   1916  6635  ab196087 	MSG_SYS_STATVFS_ALT_SIZE		/* 103 */ + \
   1917  6635  ab196087 	MSG_SYS_FSTATVFS_ALT_SIZE		/* 104 */ + \
   1918  6635  ab196087 	MSG_SYS_GETLOADAVG_ALT_SIZE		/* 105 */ + \
   1919  6635  ab196087 	MSG_SYS_NFSSYS_ALT_SIZE			/* 106 */ + \
   1920  6635  ab196087 	MSG_SYS_WAITID_ALT_SIZE			/* 107 */ + \
   1921  6635  ab196087 	MSG_SYS_SIGSENDSYS_ALT_SIZE		/* 108 */ + \
   1922  6635  ab196087 	MSG_SYS_HRTSYS_ALT_SIZE			/* 109 */ + \
   1923  6635  ab196087 	MSG_SYS_110_SIZE			/* 110 (unused) */ + \
   1924  6635  ab196087 	MSG_SYS_SIGRESEND_ALT_SIZE		/* 111 */ + \
   1925  6635  ab196087 	MSG_SYS_PRIOCNTLSYS_ALT_SIZE		/* 112 */ + \
   1926  6635  ab196087 	MSG_SYS_PATHCONF_ALT_SIZE		/* 113 */ + \
   1927  6635  ab196087 	MSG_SYS_MINCORE_ALT_SIZE		/* 114 */ + \
   1928  6635  ab196087 	MSG_SYS_MMAP_ALT_SIZE			/* 115 */ + \
   1929  6635  ab196087 	MSG_SYS_MPROTECT_ALT_SIZE		/* 116 */ + \
   1930  6635  ab196087 	MSG_SYS_MUNMAP_ALT_SIZE			/* 117 */ + \
   1931  6635  ab196087 	MSG_SYS_FPATHCONF_ALT_SIZE		/* 118 */ + \
   1932  6635  ab196087 	MSG_SYS_VFORK_ALT_SIZE			/* 119 */ + \
   1933  6635  ab196087 	MSG_SYS_FCHDIR_ALT_SIZE			/* 120 */ + \
   1934  6635  ab196087 	MSG_SYS_READV_ALT_SIZE			/* 121 */ + \
   1935  6635  ab196087 	MSG_SYS_WRITEV_ALT_SIZE			/* 122 */ + \
   1936  6635  ab196087 	MSG_SYS_XSTAT_ALT_SIZE			/* 123 */ + \
   1937  6635  ab196087 	MSG_SYS_LXSTAT_ALT_SIZE			/* 124 */ + \
   1938  6635  ab196087 	MSG_SYS_FXSTAT_ALT_SIZE			/* 125 */ + \
   1939  6635  ab196087 	MSG_SYS_XMKNOD_ALT_SIZE			/* 126 */ + \
   1940  6635  ab196087 	MSG_SYS_127_SIZE			/* 127 (unused) */ + \
   1941  6635  ab196087 	MSG_SYS_SETRLIMIT_ALT_SIZE		/* 128 */ + \
   1942  6635  ab196087 	\
   1943  6635  ab196087 	/* sysset_t[4] - System Calls [129 - 160] */ \
   1944  6635  ab196087 	MSG_SYS_GETRLIMIT_ALT_SIZE		/* 129 */ + \
   1945  6635  ab196087 	MSG_SYS_LCHOWN_ALT_SIZE			/* 130 */ + \
   1946  6635  ab196087 	MSG_SYS_MEMCNTL_ALT_SIZE		/* 131 */ + \
   1947  6635  ab196087 	MSG_SYS_GETPMSG_ALT_SIZE		/* 132 */ + \
   1948  6635  ab196087 	MSG_SYS_PUTPMSG_ALT_SIZE		/* 133 */ + \
   1949  6635  ab196087 	MSG_SYS_RENAME_ALT_SIZE			/* 134 */ + \
   1950  6635  ab196087 	MSG_SYS_UNAME_ALT_SIZE			/* 135 */ + \
   1951  6635  ab196087 	MSG_SYS_SETEGID_ALT_SIZE		/* 136 */ + \
   1952  6635  ab196087 	MSG_SYS_SYSCONFIG_ALT_SIZE		/* 137 */ + \
   1953  6635  ab196087 	MSG_SYS_ADJTIME_ALT_SIZE		/* 138 */ + \
   1954  6635  ab196087 	MSG_SYS_SYSTEMINFO_ALT_SIZE		/* 139 */ + \
   1955  6635  ab196087 	MSG_SYS_SHAREFS_ALT_SIZE		/* 140 */ + \
   1956  6635  ab196087 	MSG_SYS_SETEUID_ALT_SIZE		/* 141 */ + \
   1957  6635  ab196087 	MSG_SYS_FORKSYS_ALT_SIZE		/* 142 */ + \
   1958  6635  ab196087 	MSG_SYS_FORK1_ALT_SIZE			/* 143 */ + \
   1959  6635  ab196087 	MSG_SYS_SIGTIMEDWAIT_ALT_SIZE		/* 144 */ + \
   1960  6635  ab196087 	MSG_SYS_LWP_INFO_ALT_SIZE		/* 145 */ + \
   1961  6635  ab196087 	MSG_SYS_YIELD_ALT_SIZE			/* 146 */ + \
   1962  6635  ab196087 	MSG_SYS_LWP_SEMA_WAIT_ALT_SIZE		/* 147 */ + \
   1963  6635  ab196087 	MSG_SYS_LWP_SEMA_POST_ALT_SIZE		/* 148 */ + \
   1964  6635  ab196087 	MSG_SYS_LWP_SEMA_TRYWAIT_ALT_SIZE	/* 149 */ + \
   1965  6635  ab196087 	MSG_SYS_LWP_DETACH_ALT_SIZE		/* 150 */ + \
   1966  6635  ab196087 	MSG_SYS_CORECTL_ALT_SIZE		/* 151 */ + \
   1967  6635  ab196087 	MSG_SYS_MODCTL_ALT_SIZE			/* 152 */ + \
   1968  6635  ab196087 	MSG_SYS_FCHROOT_ALT_SIZE		/* 153 */ + \
   1969  6635  ab196087 	MSG_SYS_UTIMES_ALT_SIZE			/* 154 */ + \
   1970  6635  ab196087 	MSG_SYS_VHANGUP_ALT_SIZE		/* 155 */ + \
   1971  6635  ab196087 	MSG_SYS_GETTIMEOFDAY_ALT_SIZE		/* 156 */ + \
   1972  6635  ab196087 	MSG_SYS_GETITIMER_ALT_SIZE		/* 157 */ + \
   1973  6635  ab196087 	MSG_SYS_SETITIMER_ALT_SIZE		/* 158 */ + \
   1974  6635  ab196087 	MSG_SYS_LWP_CREATE_ALT_SIZE		/* 159 */ + \
   1975  6635  ab196087 	MSG_SYS_LWP_EXIT_ALT_SIZE		/* 160 */ + \
   1976  6635  ab196087 	\
   1977  6635  ab196087 	/* sysset_t[5] - System Calls [161 - 192] */ \
   1978  6635  ab196087 	MSG_SYS_LWP_SUSPEND_ALT_SIZE		/* 161 */ + \
   1979  6635  ab196087 	MSG_SYS_LWP_CONTINUE_ALT_SIZE		/* 162 */ + \
   1980  6635  ab196087 	MSG_SYS_LWP_KILL_ALT_SIZE		/* 163 */ + \
   1981  6635  ab196087 	MSG_SYS_LWP_SELF_ALT_SIZE		/* 164 */ + \
   1982  6635  ab196087 	MSG_SYS_LWP_SIGMASK_ALT_SIZE		/* 165 */ + \
   1983  6635  ab196087 	MSG_SYS_LWP_PRIVATE_ALT_SIZE		/* 166 */ + \
   1984  6635  ab196087 	MSG_SYS_LWP_WAIT_ALT_SIZE		/* 167 */ + \
   1985  6635  ab196087 	MSG_SYS_LWP_MUTEX_WAKEUP_ALT_SIZE	/* 168 */ + \
   1986  6635  ab196087 	MSG_SYS_LWP_MUTEX_LOCK_ALT_SIZE		/* 169 */ + \
   1987  6635  ab196087 	MSG_SYS_LWP_COND_WAIT_ALT_SIZE		/* 170 */ + \
   1988  6635  ab196087 	MSG_SYS_LWP_COND_SIGNAL_ALT_SIZE	/* 171 */ + \
   1989  6635  ab196087 	MSG_SYS_LWP_COND_BROADCAST_ALT_SIZE	/* 172 */ + \
   1990  6635  ab196087 	MSG_SYS_PREAD_ALT_SIZE			/* 173 */ + \
   1991  6635  ab196087 	MSG_SYS_PWRITE_ALT_SIZE			/* 174 */ + \
   1992  6635  ab196087 	MSG_SYS_LLSEEK_ALT_SIZE			/* 175 */ + \
   1993  6635  ab196087 	MSG_SYS_INST_SYNC_ALT_SIZE		/* 176 */ + \
   1994  6635  ab196087 	MSG_SYS_BRAND_ALT_SIZE			/* 177 */ + \
   1995  6635  ab196087 	MSG_SYS_KAIO_ALT_SIZE			/* 178 */ + \
   1996  6635  ab196087 	MSG_SYS_CPC_ALT_SIZE			/* 179 */ + \
   1997  6635  ab196087 	MSG_SYS_LGRPSYS_ALT_SIZE		/* 180 */ + \
   1998  6635  ab196087 	MSG_SYS_RUSAGESYS_ALT_SIZE		/* 181 */ + \
   1999  6635  ab196087 	MSG_SYS_PORT_ALT_SIZE			/* 182 */ + \
   2000  6635  ab196087 	MSG_SYS_POLLSYS_ALT_SIZE		/* 183 */ + \
   2001  6635  ab196087 	MSG_SYS_LABELSYS_ALT_SIZE		/* 184 */ + \
   2002  6635  ab196087 	MSG_SYS_ACL_ALT_SIZE			/* 185 */ + \
   2003  6635  ab196087 	MSG_SYS_AUDITSYS_ALT_SIZE		/* 186 */ + \
   2004  6635  ab196087 	MSG_SYS_PROCESSOR_BIND_ALT_SIZE		/* 187 */ + \
   2005  6635  ab196087 	MSG_SYS_PROCESSOR_INFO_ALT_SIZE		/* 188 */ + \
   2006  6635  ab196087 	MSG_SYS_P_ONLINE_ALT_SIZE		/* 189 */ + \
   2007  6635  ab196087 	MSG_SYS_SIGQUEUE_ALT_SIZE		/* 190 */ + \
   2008  6635  ab196087 	MSG_SYS_CLOCK_GETTIME_ALT_SIZE		/* 191 */ + \
   2009  6635  ab196087 	MSG_SYS_CLOCK_SETTIME_ALT_SIZE		/* 192 */ + \
   2010  6635  ab196087 	\
   2011  6635  ab196087 	/* sysset_t[6] - System Calls [193 - 224] */ \
   2012  6635  ab196087 	MSG_SYS_CLOCK_GETRES_ALT_SIZE		/* 193 */ + \
   2013  6635  ab196087 	MSG_SYS_TIMER_CREATE_ALT_SIZE		/* 194 */ + \
   2014  6635  ab196087 	MSG_SYS_TIMER_DELETE_ALT_SIZE		/* 195 */ + \
   2015  6635  ab196087 	MSG_SYS_TIMER_SETTIME_ALT_SIZE		/* 196 */ + \
   2016  6635  ab196087 	MSG_SYS_TIMER_GETTIME_ALT_SIZE		/* 197 */ + \
   2017  6635  ab196087 	MSG_SYS_TIMER_GETOVERRUN_ALT_SIZE	/* 198 */ + \
   2018  6635  ab196087 	MSG_SYS_NANOSLEEP_ALT_SIZE		/* 199 */ + \
   2019  6635  ab196087 	MSG_SYS_FACL_ALT_SIZE			/* 200 */ + \
   2020  6635  ab196087 	MSG_SYS_DOOR_ALT_SIZE			/* 201 */ + \
   2021  6635  ab196087 	MSG_SYS_SETREUID_ALT_SIZE		/* 202 */ + \
   2022  6635  ab196087 	MSG_SYS_SETREGID_ALT_SIZE		/* 203 */ + \
   2023  6635  ab196087 	MSG_SYS_INSTALL_UTRAP_ALT_SIZE		/* 204 */ + \
   2024  6635  ab196087 	MSG_SYS_SIGNOTIFY_ALT_SIZE		/* 205 */ + \
   2025  6635  ab196087 	MSG_SYS_SCHEDCTL_ALT_SIZE		/* 206 */ + \
   2026  6635  ab196087 	MSG_SYS_PSET_ALT_SIZE			/* 207 */ + \
   2027  6635  ab196087 	MSG_SYS_SPARC_UTRAP_INSTALL_ALT_SIZE	/* 208 */ + \
   2028  6635  ab196087 	MSG_SYS_RESOLVEPATH_ALT_SIZE		/* 209 */ + \
   2029  6635  ab196087 	MSG_SYS_LWP_MUTEX_TIMEDLOCK_ALT_SIZE	/* 210 */ + \
   2030  6635  ab196087 	MSG_SYS_LWP_SEMA_TIMEDWAIT_ALT_SIZE	/* 211 */ + \
   2031  6635  ab196087 	MSG_SYS_LWP_RWLOCK_SYS_ALT_SIZE		/* 212 */ + \
   2032  6635  ab196087 	MSG_SYS_GETDENTS64_ALT_SIZE		/* 213 */ + \
   2033  6635  ab196087 	MSG_SYS_MMAP64_ALT_SIZE			/* 214 */ + \
   2034  6635  ab196087 	MSG_SYS_STAT64_ALT_SIZE			/* 215 */ + \
   2035  6635  ab196087 	MSG_SYS_LSTAT64_ALT_SIZE		/* 216 */ + \
   2036  6635  ab196087 	MSG_SYS_FSTAT64_ALT_SIZE		/* 217 */ + \
   2037  6635  ab196087 	MSG_SYS_STATVFS64_ALT_SIZE		/* 218 */ + \
   2038  6635  ab196087 	MSG_SYS_FSTATVFS64_ALT_SIZE		/* 219 */ + \
   2039  6635  ab196087 	MSG_SYS_SETRLIMIT64_ALT_SIZE		/* 220 */ + \
   2040  6635  ab196087 	MSG_SYS_GETRLIMIT64_ALT_SIZE		/* 221 */ + \
   2041  6635  ab196087 	MSG_SYS_PREAD64_ALT_SIZE		/* 222 */ + \
   2042  6635  ab196087 	MSG_SYS_PWRITE64_ALT_SIZE		/* 223 */ + \
   2043  6635  ab196087 	MSG_SYS_CREAT64_ALT_SIZE		/* 224 */ + \
   2044  6635  ab196087 	\
   2045  6635  ab196087 	/* sysset_t[7] - System Calls [225 - 256] */ \
   2046  6635  ab196087 	MSG_SYS_OPEN64_ALT_SIZE			/* 225 */ + \
   2047  6635  ab196087 	MSG_SYS_RPCSYS_ALT_SIZE			/* 226 */ + \
   2048  6635  ab196087 	MSG_SYS_ZONE_ALT_SIZE			/* 227 */ + \
   2049  6635  ab196087 	MSG_SYS_AUTOFSSYS_ALT_SIZE		/* 228 */ + \
   2050  6635  ab196087 	MSG_SYS_GETCWD_ALT_SIZE			/* 229 */ + \
   2051  6635  ab196087 	MSG_SYS_SO_SOCKET_ALT_SIZE		/* 230 */ + \
   2052  6635  ab196087 	MSG_SYS_SO_SOCKETPAIR_ALT_SIZE		/* 231 */ + \
   2053  6635  ab196087 	MSG_SYS_BIND_ALT_SIZE			/* 232 */ + \
   2054  6635  ab196087 	MSG_SYS_LISTEN_ALT_SIZE			/* 233 */ + \
   2055  6635  ab196087 	MSG_SYS_ACCEPT_ALT_SIZE			/* 234 */ + \
   2056  6635  ab196087 	MSG_SYS_CONNECT_ALT_SIZE		/* 235 */ + \
   2057  6635  ab196087 	MSG_SYS_SHUTDOWN_ALT_SIZE		/* 236 */ + \
   2058  6635  ab196087 	MSG_SYS_RECV_ALT_SIZE			/* 237 */ + \
   2059  6635  ab196087 	MSG_SYS_RECVFROM_ALT_SIZE		/* 238 */ + \
   2060  6635  ab196087 	MSG_SYS_RECVMSG_ALT_SIZE		/* 239 */ + \
   2061  6635  ab196087 	MSG_SYS_SEND_ALT_SIZE			/* 240 */ + \
   2062  6635  ab196087 	MSG_SYS_SENDMSG_ALT_SIZE		/* 241 */ + \
   2063  6635  ab196087 	MSG_SYS_SENDTO_ALT_SIZE			/* 242 */ + \
   2064  6635  ab196087 	MSG_SYS_GETPEERNAME_ALT_SIZE		/* 243 */ + \
   2065  6635  ab196087 	MSG_SYS_GETSOCKNAME_ALT_SIZE		/* 244 */ + \
   2066  6635  ab196087 	MSG_SYS_GETSOCKOPT_ALT_SIZE		/* 245 */ + \
   2067  6635  ab196087 	MSG_SYS_SETSOCKOPT_ALT_SIZE		/* 246 */ + \
   2068  6635  ab196087 	MSG_SYS_SOCKCONFIG_ALT_SIZE		/* 247 */ + \
   2069  6635  ab196087 	MSG_SYS_NTP_GETTIME_ALT_SIZE		/* 248 */ + \
   2070  6635  ab196087 	MSG_SYS_NTP_ADJTIME_ALT_SIZE		/* 249 */ + \
   2071  6635  ab196087 	MSG_SYS_LWP_MUTEX_UNLOCK_ALT_SIZE	/* 250 */ + \
   2072  6635  ab196087 	MSG_SYS_LWP_MUTEX_TRYLOCK_ALT_SIZE	/* 251 */ + \
   2073  6635  ab196087 	MSG_SYS_LWP_MUTEX_REGISTER_ALT_SIZE	/* 252 */ + \
   2074  6635  ab196087 	MSG_SYS_CLADM_ALT_SIZE			/* 253 */ + \
   2075  6635  ab196087 	MSG_SYS_UUCOPY_ALT_SIZE			/* 254 */ + \
   2076  6635  ab196087 	MSG_SYS_UMOUNT2_ALT_SIZE		/* 255 */ + \
   2077  6635  ab196087 	3					/* 256 (unused) */ + \
   2078  6635  ab196087 	\
   2079  6635  ab196087 	/* sysset_t[8] - System Calls [257 - 288] */ \
   2080  6635  ab196087 	(32 * 3)				/* 257 - 288 (unused) */ + \
   2081  6635  ab196087 	\
   2082  6635  ab196087 	/* sysset_t[9] - System Calls [289 - 320] */ \
   2083  6635  ab196087 	(32 * 3)				/* 289 - 320 (unused) */ + \
   2084  6635  ab196087 	\
   2085  6635  ab196087 	/* sysset_t[10] - System Calls [321 - 352] */ \
   2086  6635  ab196087 	(32 * 3)				/* 321 - 352 (unused) */ + \
   2087  6635  ab196087 	\
   2088  6635  ab196087 	/* sysset_t[11] - System Calls [353 - 384] */ \
   2089  6635  ab196087 	(32 * 3)				/* 353 - 384 (unused) */ + \
   2090  6635  ab196087 	\
   2091  6635  ab196087 	/* sysset_t[12] - System Calls [385 - 416] */ \
   2092  6635  ab196087 	(32 * 3)				/* 385 - 416 (unused) */ + \
   2093  6635  ab196087 	\
   2094  6635  ab196087 	/* sysset_t[13] - System Calls [417 - 448] */ \
   2095  6635  ab196087 	(32 * 3)				/* 417 - 448 (unused) */ + \
   2096  6635  ab196087 	\
   2097  6635  ab196087 	/* sysset_t[14] - System Calls [449 - 480] */ \
   2098  6635  ab196087 	(32 * 3)				/* 449 - 480 (unused) */ + \
   2099  6635  ab196087 	\
   2100  6635  ab196087 	/* sysset_t[15] - System Calls [481 - 512] */ \
   2101  6635  ab196087 	(32 * 3)				/* 481 - 512 (unused) */ + \
   2102  6635  ab196087 	\
   2103  6635  ab196087 	CONV_INV_BUFSIZE	+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
   2104  6635  ab196087 
   2105  6635  ab196087 /*
   2106  6635  ab196087  * Ensure that Conv_cnote_sysset_buf_t is large enough:
   2107  6635  ab196087  *
   2108  6635  ab196087  * SYSSET_FLAGSZ is the real minimum size of the buffer required by
   2109  6635  ab196087  * conv_cnote_sysset(). However, Conv_cnote_sysset_buf_t
   2110  6635  ab196087  * uses CONV_CNOTE_SYSSET_BUFSIZE to set the buffer size. We do
   2111  6635  ab196087  * things this way because the definition of SYSSET_FLAGSZ uses information
   2112  6635  ab196087  * that is not available in the environment of other programs
   2113  6635  ab196087  * that include the conv.h header file.
   2114  6635  ab196087  */
   2115  6635  ab196087 #if (CONV_CNOTE_SYSSET_BUFSIZE != SYSSET_FLAGSZ) && !defined(__lint)
   2116  6635  ab196087 #define	REPORT_BUFSIZE SYSSET_FLAGSZ
   2117  6635  ab196087 #include "report_bufsize.h"
   2118  6635  ab196087 #error "CONV_CNOTE_SYSSET_BUFSIZE does not match SYSSET_FLAGSZ"
   2119  6635  ab196087 #endif
   2120  6635  ab196087 
   2121  6635  ab196087 const char *
   2122  6635  ab196087 conv_cnote_sysset(uint32_t *maskarr, int n_mask,
   2123  6635  ab196087     Conv_fmt_flags_t fmt_flags, Conv_cnote_sysset_buf_t *cnote_sysset_buf)
   2124  6635  ab196087 {
   2125  6635  ab196087 #define	N_MASK 16
   2126  6635  ab196087 
   2127  9273       Ali 	static const Val_desc vda0[] = {	/* System Calls [1 - 32] */
   2128  9273       Ali 		{ 0x00000001,	MSG_SYS_EXIT_ALT },
   2129  9273       Ali 		{ 0x00000002,	MSG_SYS_FORKALL_ALT },
   2130  9273       Ali 		{ 0x00000004,	MSG_SYS_READ_ALT },
   2131  9273       Ali 		{ 0x00000008,	MSG_SYS_WRITE_ALT },
   2132  9273       Ali 		{ 0x00000010,	MSG_SYS_OPEN_ALT },
   2133  9273       Ali 		{ 0x00000020,	MSG_SYS_CLOSE_ALT },
   2134  9273       Ali 		{ 0x00000040,	MSG_SYS_WAIT_ALT },
   2135  9273       Ali 		{ 0x00000080,	MSG_SYS_CREAT_ALT },
   2136  9273       Ali 		{ 0x00000100,	MSG_SYS_LINK_ALT },
   2137  9273       Ali 		{ 0x00000200,	MSG_SYS_UNLINK_ALT },
   2138  9273       Ali 		{ 0x00000400,	MSG_SYS_EXEC_ALT },
   2139  9273       Ali 		{ 0x00000800,	MSG_SYS_CHDIR_ALT },
   2140  9273       Ali 		{ 0x00001000,	MSG_SYS_TIME_ALT },
   2141  9273       Ali 		{ 0x00002000,	MSG_SYS_MKNOD_ALT },
   2142  9273       Ali 		{ 0x00004000,	MSG_SYS_CHMOD_ALT },
   2143  9273       Ali 		{ 0x00008000,	MSG_SYS_CHOWN_ALT },
   2144  9273       Ali 		{ 0x00010000,	MSG_SYS_BRK_ALT },
   2145  9273       Ali 		{ 0x00020000,	MSG_SYS_STAT_ALT },
   2146  9273       Ali 		{ 0x00040000,	MSG_SYS_LSEEK_ALT },
   2147  9273       Ali 		{ 0x00080000,	MSG_SYS_GETPID_ALT },
   2148  9273       Ali 		{ 0x00100000,	MSG_SYS_MOUNT_ALT },
   2149  9273       Ali 		{ 0x00200000,	MSG_SYS_UMOUNT_ALT },
   2150  9273       Ali 		{ 0x00400000,	MSG_SYS_SETUID_ALT },
   2151  9273       Ali 		{ 0x00800000,	MSG_SYS_GETUID_ALT },
   2152  9273       Ali 		{ 0x01000000,	MSG_SYS_STIME_ALT },
   2153  9273       Ali 		{ 0x02000000,	MSG_SYS_PCSAMPLE_ALT },
   2154  9273       Ali 		{ 0x04000000,	MSG_SYS_ALARM_ALT },
   2155  9273       Ali 		{ 0x08000000,	MSG_SYS_FSTAT_ALT },
   2156  9273       Ali 		{ 0x10000000,	MSG_SYS_PAUSE_ALT },
   2157  9273       Ali 		{ 0x20000000,	MSG_SYS_UTIME_ALT },
   2158  9273       Ali 		{ 0x40000000,	MSG_SYS_STTY_ALT },
   2159  9273       Ali 		{ 0x80000000,	MSG_SYS_GTTY_ALT },
   2160  6635  ab196087 		{ 0,		0 }
   2161  6635  ab196087 	};
   2162  9273       Ali 	static const Val_desc vda1[] = {	/* System Calls [33 - 64] */
   2163  9273       Ali 		{ 0x00000001,	MSG_SYS_ACCESS_ALT },
   2164  9273       Ali 		{ 0x00000002,	MSG_SYS_NICE_ALT },
   2165  9273       Ali 		{ 0x00000004,	MSG_SYS_STATFS_ALT },
   2166  9273       Ali 		{ 0x00000008,	MSG_SYS_SYNC_ALT },
   2167  9273       Ali 		{ 0x00000010,	MSG_SYS_KILL_ALT },
   2168  9273       Ali 		{ 0x00000020,	MSG_SYS_FSTATFS_ALT },
   2169  9273       Ali 		{ 0x00000040,	MSG_SYS_PGRPSYS_ALT },
   2170  9273       Ali 		{ 0x00000080,	MSG_SYS_UUCOPYSTR_ALT },
   2171  9273       Ali 		{ 0x00000100,	MSG_SYS_DUP_ALT },
   2172  9273       Ali 		{ 0x00000200,	MSG_SYS_PIPE_ALT },
   2173  9273       Ali 		{ 0x00000400,	MSG_SYS_TIMES_ALT },
   2174  9273       Ali 		{ 0x00000800,	MSG_SYS_PROFIL_ALT },
   2175  9273       Ali 		{ 0x00001000,	MSG_SYS_PLOCK_ALT },
   2176  9273       Ali 		{ 0x00002000,	MSG_SYS_SETGID_ALT },
   2177  9273       Ali 		{ 0x00004000,	MSG_SYS_GETGID_ALT },
   2178  9273       Ali 		{ 0x00008000,	MSG_SYS_SIGNAL_ALT },
   2179  9273       Ali 		{ 0x00010000,	MSG_SYS_MSGSYS_ALT },
   2180  9273       Ali 		{ 0x00020000,	MSG_SYS_SYSI86_ALT },
   2181  9273       Ali 		{ 0x00040000,	MSG_SYS_ACCT_ALT },
   2182  9273       Ali 		{ 0x00080000,	MSG_SYS_SHMSYS_ALT },
   2183  9273       Ali 		{ 0x00100000,	MSG_SYS_SEMSYS_ALT },
   2184  9273       Ali 		{ 0x00200000,	MSG_SYS_IOCTL_ALT },
   2185  9273       Ali 		{ 0x00400000,	MSG_SYS_UADMIN_ALT },
   2186  9273       Ali 		{ 0x00800000,	MSG_SYS_56 },
   2187  9273       Ali 		{ 0x01000000,	MSG_SYS_UTSSYS_ALT },
   2188  9273       Ali 		{ 0x0200000,	MSG_SYS_FDSYNC_ALT },
   2189  9273       Ali 		{ 0x04000000,	MSG_SYS_EXECVE_ALT },
   2190  9273       Ali 		{ 0x08000000,	MSG_SYS_UMASK_ALT },
   2191  9273       Ali 		{ 0x10000000,	MSG_SYS_CHROOT_ALT },
   2192  9273       Ali 		{ 0x20000000,	MSG_SYS_FCNTL_ALT },
   2193  9273       Ali 		{ 0x40000000,	MSG_SYS_ULIMIT_ALT },
   2194  9273       Ali 		{ 0x80000000,	MSG_SYS_64 },
   2195  6635  ab196087 		{ 0,		0 }
   2196  6635  ab196087 	};
   2197  9273       Ali 	static const Val_desc vda2[] = {	/* System Calls [65 - 96] */
   2198  9273       Ali 		{ 0x00000001,	MSG_SYS_65 },
   2199  9273       Ali 		{ 0x00000002,	MSG_SYS_66 },
   2200  9273       Ali 		{ 0x00000004,	MSG_SYS_67 },
   2201  9273       Ali 		{ 0x00000008,	MSG_SYS_68 },
   2202  9273       Ali 		{ 0x00000010,	MSG_SYS_69 },
   2203  9273       Ali 		{ 0x00000020,	MSG_SYS_TASKSYS_ALT },
   2204  9273       Ali 		{ 0x00000040,	MSG_SYS_ACCTCTL_ALT },
   2205  9273       Ali 		{ 0x00000080,	MSG_SYS_EXACCTSYS_ALT },
   2206  9273       Ali 		{ 0x00000100,	MSG_SYS_GETPAGESIZES_ALT },
   2207  9273       Ali 		{ 0x00000200,	MSG_SYS_RCTLSYS_ALT },
   2208  9273       Ali 		{ 0x00000400,	MSG_SYS_SIDSYS_ALT },
   2209  9273       Ali 		{ 0x00000800,	MSG_SYS_FSAT_ALT },
   2210  9273       Ali 		{ 0x00001000,	MSG_SYS_LWP_PARK_ALT },
   2211  9273       Ali 		{ 0x00002000,	MSG_SYS_SENDFILEV_ALT },
   2212  9273       Ali 		{ 0x00004000,	MSG_SYS_RMDIR_ALT },
   2213  9273       Ali 		{ 0x00008000,	MSG_SYS_MKDIR_ALT },
   2214  9273       Ali 		{ 0x00010000,	MSG_SYS_GETDENTS_ALT },
   2215  9273       Ali 		{ 0x00020000,	MSG_SYS_PRIVSYS_ALT },
   2216  9273       Ali 		{ 0x00040000,	MSG_SYS_UCREDSYS_ALT },
   2217  9273       Ali 		{ 0x00080000,	MSG_SYS_SYSFS_ALT },
   2218  9273       Ali 		{ 0x00100000,	MSG_SYS_GETMSG_ALT },
   2219  9273       Ali 		{ 0x00200000,	MSG_SYS_PUTMSG_ALT },
   2220  9273       Ali 		{ 0x00400000,	MSG_SYS_POLL_ALT },
   2221  9273       Ali 		{ 0x00800000,	MSG_SYS_LSTAT_ALT },
   2222  9273       Ali 		{ 0x01000000,	MSG_SYS_SYMLINK_ALT },
   2223  9273       Ali 		{ 0x02000000,	MSG_SYS_READLINK_ALT },
   2224  9273       Ali 		{ 0x04000000,	MSG_SYS_SETGROUPS_ALT },
   2225  9273       Ali 		{ 0x08000000,	MSG_SYS_GETGROUPS_ALT },
   2226  9273       Ali 		{ 0x10000000,	MSG_SYS_FCHMOD_ALT },
   2227  9273       Ali 		{ 0x20000000,	MSG_SYS_FCHOWN_ALT },
   2228  9273       Ali 		{ 0x40000000,	MSG_SYS_SIGPROCMASK_ALT },
   2229  9273       Ali 		{ 0x80000000,	MSG_SYS_SIGSUSPEND_ALT },
   2230  6635  ab196087 		{ 0,		0 }
   2231  6635  ab196087 	};
   2232  9273       Ali 	static const Val_desc vda3[] = {	/* System Calls [97 - 128] */
   2233  9273       Ali 		{ 0x00000001,	MSG_SYS_SIGALTSTACK_ALT },
   2234  9273       Ali 		{ 0x00000002,	MSG_SYS_SIGACTION_ALT },
   2235  9273       Ali 		{ 0x00000004,	MSG_SYS_SIGPENDING_ALT },
   2236  9273       Ali 		{ 0x00000008,	MSG_SYS_CONTEXT_ALT },
   2237  9273       Ali 		{ 0x00000010,	MSG_SYS_EVSYS_ALT },
   2238  9273       Ali 		{ 0x00000020,	MSG_SYS_EVTRAPRET_ALT },
   2239  9273       Ali 		{ 0x00000040,	MSG_SYS_STATVFS_ALT },
   2240  9273       Ali 		{ 0x00000080,	MSG_SYS_FSTATVFS_ALT },
   2241  9273       Ali 		{ 0x00000100,	MSG_SYS_GETLOADAVG_ALT },
   2242  9273       Ali 		{ 0x00000200,	MSG_SYS_NFSSYS_ALT },
   2243  9273       Ali 		{ 0x00000400,	MSG_SYS_WAITID_ALT },
   2244  9273       Ali 		{ 0x00000800,	MSG_SYS_SIGSENDSYS_ALT },
   2245  9273       Ali 		{ 0x00001000,	MSG_SYS_HRTSYS_ALT },
   2246  9273       Ali 		{ 0x00002000,	MSG_SYS_110 },
   2247  9273       Ali 		{ 0x00004000,	MSG_SYS_SIGRESEND_ALT },
   2248  9273       Ali 		{ 0x00008000,	MSG_SYS_PRIOCNTLSYS_ALT },
   2249  9273       Ali 		{ 0x00010000,	MSG_SYS_PATHCONF_ALT },
   2250  9273       Ali 		{ 0x00020000,	MSG_SYS_MINCORE_ALT },
   2251  9273       Ali 		{ 0x00040000,	MSG_SYS_MMAP_ALT },
   2252  9273       Ali 		{ 0x00080000,	MSG_SYS_MPROTECT_ALT },
   2253  9273       Ali 		{ 0x00100000,	MSG_SYS_MUNMAP_ALT },
   2254  9273       Ali 		{ 0x00200000,	MSG_SYS_FPATHCONF_ALT },
   2255  9273       Ali 		{ 0x00400000,	MSG_SYS_VFORK_ALT },
   2256  9273       Ali 		{ 0x00800000,	MSG_SYS_FCHDIR_ALT },
   2257  9273       Ali 		{ 0x01000000,	MSG_SYS_READV_ALT },
   2258  9273       Ali 		{ 0x02000000,	MSG_SYS_WRITEV_ALT },
   2259  9273       Ali 		{ 0x04000000,	MSG_SYS_XSTAT_ALT },
   2260  9273       Ali 		{ 0x08000000,	MSG_SYS_LXSTAT_ALT },
   2261  9273       Ali 		{ 0x10000000,	MSG_SYS_FXSTAT_ALT },
   2262  9273       Ali 		{ 0x20000000,	MSG_SYS_XMKNOD_ALT },
   2263  9273       Ali 		{ 0x40000000,	MSG_SYS_127 },
   2264  9273       Ali 		{ 0x80000000,	MSG_SYS_SETRLIMIT_ALT },
   2265  6635  ab196087 		{ 0,			0 }
   2266  6635  ab196087 	};
   2267  9273       Ali 	static const Val_desc vda4[] = {	/* System Calls [129 - 160] */
   2268  9273       Ali 		{ 0x00000001,	MSG_SYS_GETRLIMIT_ALT },
   2269  9273       Ali 		{ 0x00000002,	MSG_SYS_LCHOWN_ALT },
   2270  9273       Ali 		{ 0x00000004,	MSG_SYS_MEMCNTL_ALT },
   2271  9273       Ali 		{ 0x00000008,	MSG_SYS_GETPMSG_ALT },
   2272  9273       Ali 		{ 0x00000010,	MSG_SYS_PUTPMSG_ALT },
   2273  9273       Ali 		{ 0x00000020,	MSG_SYS_RENAME_ALT },
   2274  9273       Ali 		{ 0x00000040,	MSG_SYS_UNAME_ALT },
   2275  9273       Ali 		{ 0x00000080,	MSG_SYS_SETEGID_ALT },
   2276  9273       Ali 		{ 0x00000100,	MSG_SYS_SYSCONFIG_ALT },
   2277  9273       Ali 		{ 0x00000200,	MSG_SYS_ADJTIME_ALT },
   2278  9273       Ali 		{ 0x00000400,	MSG_SYS_SYSTEMINFO_ALT },
   2279  9273       Ali 		{ 0x00000800,	MSG_SYS_SHAREFS_ALT },
   2280  9273       Ali 		{ 0x00001000,	MSG_SYS_SETEUID_ALT },
   2281  9273       Ali 		{ 0x00002000,	MSG_SYS_FORKSYS_ALT },
   2282  9273       Ali 		{ 0x00004000,	MSG_SYS_FORK1_ALT },
   2283  9273       Ali 		{ 0x00008000,	MSG_SYS_SIGTIMEDWAIT_ALT },
   2284  9273       Ali 		{ 0x00010000,	MSG_SYS_LWP_INFO_ALT },
   2285  9273       Ali 		{ 0x00020000,	MSG_SYS_YIELD_ALT },
   2286  9273       Ali 		{ 0x00040000,	MSG_SYS_LWP_SEMA_WAIT_ALT },
   2287  9273       Ali 		{ 0x00080000,	MSG_SYS_LWP_SEMA_POST_ALT },
   2288  9273       Ali 		{ 0x00100000,	MSG_SYS_LWP_SEMA_TRYWAIT_ALT },
   2289  9273       Ali 		{ 0x00200000,	MSG_SYS_LWP_DETACH_ALT },
   2290  9273       Ali 		{ 0x00400000,	MSG_SYS_CORECTL_ALT },
   2291  9273       Ali 		{ 0x00800000,	MSG_SYS_MODCTL_ALT },
   2292  9273       Ali 		{ 0x01000000,	MSG_SYS_FCHROOT_ALT },
   2293  9273       Ali 		{ 0x02000000,	MSG_SYS_UTIMES_ALT },
   2294  9273       Ali 		{ 0x04000000,	MSG_SYS_VHANGUP_ALT },
   2295  9273       Ali 		{ 0x08000000,	MSG_SYS_GETTIMEOFDAY_ALT },
   2296  9273       Ali 		{ 0x10000000,	MSG_SYS_GETITIMER_ALT },
   2297  9273       Ali 		{ 0x20000000,	MSG_SYS_SETITIMER_ALT },
   2298  9273       Ali 		{ 0x40000000,	MSG_SYS_LWP_CREATE_ALT },
   2299  9273       Ali 		{ 0x80000000,	MSG_SYS_LWP_EXIT_ALT },
   2300  6635  ab196087 		{ 0,		0 }
   2301  6635  ab196087 	};
   2302  9273       Ali 	static const Val_desc vda5[] = {	/* System Calls [161 - 192] */
   2303  9273       Ali 		{ 0x00000001,	MSG_SYS_LWP_SUSPEND_ALT },
   2304  9273       Ali 		{ 0x00000002,	MSG_SYS_LWP_CONTINUE_ALT },
   2305  9273       Ali 		{ 0x00000004,	MSG_SYS_LWP_KILL_ALT },
   2306  9273       Ali 		{ 0x00000008,	MSG_SYS_LWP_SELF_ALT },
   2307  9273       Ali 		{ 0x00000010,	MSG_SYS_LWP_SIGMASK_ALT },
   2308  9273       Ali 		{ 0x00000020,	MSG_SYS_LWP_PRIVATE_ALT },
   2309  9273       Ali 		{ 0x00000040,	MSG_SYS_LWP_WAIT_ALT },
   2310  9273       Ali 		{ 0x00000080,	MSG_SYS_LWP_MUTEX_WAKEUP_ALT },
   2311  9273       Ali 		{ 0x00000100,	MSG_SYS_LWP_MUTEX_LOCK_ALT },
   2312  9273       Ali 		{ 0x00000200,	MSG_SYS_LWP_COND_WAIT_ALT },
   2313  9273       Ali 		{ 0x00000400,	MSG_SYS_LWP_COND_SIGNAL_ALT },
   2314  9273       Ali 		{ 0x00000800,	MSG_SYS_LWP_COND_BROADCAST_ALT },
   2315  9273       Ali 		{ 0x00001000,	MSG_SYS_PREAD_ALT },
   2316  9273       Ali 		{ 0x00002000,	MSG_SYS_PWRITE_ALT },
   2317  9273       Ali 		{ 0x00004000,	MSG_SYS_LLSEEK_ALT },
   2318  9273       Ali 		{ 0x00008000,	MSG_SYS_INST_SYNC_ALT },
   2319  9273       Ali 		{ 0x00010000,	MSG_SYS_BRAND_ALT },
   2320  9273       Ali 		{ 0x00020000,	MSG_SYS_KAIO_ALT },
   2321  9273       Ali 		{ 0x00040000,	MSG_SYS_CPC_ALT },
   2322  9273       Ali 		{ 0x00080000,	MSG_SYS_LGRPSYS_ALT },
   2323  9273       Ali 		{ 0x00100000,	MSG_SYS_RUSAGESYS_ALT },
   2324  9273       Ali 		{ 0x00200000,	MSG_SYS_PORT_ALT },
   2325  9273       Ali 		{ 0x00400000,	MSG_SYS_POLLSYS_ALT },
   2326  9273       Ali 		{ 0x00800000,	MSG_SYS_LABELSYS_ALT },
   2327  9273       Ali 		{ 0x01000000,	MSG_SYS_ACL_ALT },
   2328  9273       Ali 		{ 0x02000000,	MSG_SYS_AUDITSYS_ALT },
   2329  9273       Ali 		{ 0x04000000,	MSG_SYS_PROCESSOR_BIND_ALT },
   2330  9273       Ali 		{ 0x08000000,	MSG_SYS_PROCESSOR_INFO_ALT },
   2331  9273       Ali 		{ 0x10000000,	MSG_SYS_P_ONLINE_ALT },
   2332  9273       Ali 		{ 0x20000000,	MSG_SYS_SIGQUEUE_ALT },
   2333  9273       Ali 		{ 0x40000000,	MSG_SYS_CLOCK_GETTIME_ALT },
   2334  9273       Ali 		{ 0x80000000,	MSG_SYS_CLOCK_SETTIME_ALT },
   2335  6635  ab196087 		{ 0,		0 }
   2336  6635  ab196087 	};
   2337  9273       Ali 	static const Val_desc vda6[] = {	/* System Calls [193 - 224] */
   2338  9273       Ali 		{ 0x00000001,	MSG_SYS_CLOCK_GETRES_ALT },
   2339  9273       Ali 		{ 0x00000002,	MSG_SYS_TIMER_CREATE_ALT },
   2340  9273       Ali 		{ 0x00000004,	MSG_SYS_TIMER_DELETE_ALT },
   2341  9273       Ali 		{ 0x00000008,	MSG_SYS_TIMER_SETTIME_ALT },
   2342  9273       Ali 		{ 0x00000010,	MSG_SYS_TIMER_GETTIME_ALT },
   2343  9273       Ali 		{ 0x00000020,	MSG_SYS_TIMER_GETOVERRUN_ALT },
   2344  9273       Ali 		{ 0x00000040,	MSG_SYS_NANOSLEEP_ALT },
   2345  9273       Ali 		{ 0x00000080,	MSG_SYS_FACL_ALT },
   2346  9273       Ali 		{ 0x00000100,	MSG_SYS_DOOR_ALT },
   2347  9273       Ali 		{ 0x00000200,	MSG_SYS_SETREUID_ALT },
   2348  9273       Ali 		{ 0x00000400,	MSG_SYS_SETREGID_ALT },
   2349  9273       Ali 		{ 0x00000800,	MSG_SYS_INSTALL_UTRAP_ALT },
   2350  9273       Ali 		{ 0x00001000,	MSG_SYS_SIGNOTIFY_ALT },
   2351  9273       Ali 		{ 0x00002000,	MSG_SYS_SCHEDCTL_ALT },
   2352  9273       Ali 		{ 0x00004000,	MSG_SYS_PSET_ALT },
   2353  9273       Ali 		{ 0x00008000,	MSG_SYS_SPARC_UTRAP_INSTALL_ALT },
   2354  9273       Ali 		{ 0x00010000,	MSG_SYS_RESOLVEPATH_ALT },
   2355  9273       Ali 		{ 0x00020000,	MSG_SYS_LWP_MUTEX_TIMEDLOCK_ALT },
   2356  9273       Ali 		{ 0x00040000,	MSG_SYS_LWP_SEMA_TIMEDWAIT_ALT },
   2357  9273       Ali 		{ 0x00080000,	MSG_SYS_LWP_RWLOCK_SYS_ALT },
   2358  9273       Ali 		{ 0x00100000,	MSG_SYS_GETDENTS64_ALT },
   2359  9273       Ali 		{ 0x00200000,	MSG_SYS_MMAP64_ALT },
   2360  9273       Ali 		{ 0x00400000,	MSG_SYS_STAT64_ALT },
   2361  9273       Ali 		{ 0x00800000,	MSG_SYS_LSTAT64_ALT },
   2362  9273       Ali 		{ 0x01000000,	MSG_SYS_FSTAT64_ALT },
   2363  9273       Ali 		{ 0x02000000,	MSG_SYS_STATVFS64_ALT },
   2364  9273       Ali 		{ 0x04000000,	MSG_SYS_FSTATVFS64_ALT },
   2365  9273       Ali 		{ 0x08000000,	MSG_SYS_SETRLIMIT64_ALT },
   2366  9273       Ali 		{ 0x10000000,	MSG_SYS_GETRLIMIT64_ALT },
   2367  9273       Ali 		{ 0x20000000,	MSG_SYS_PREAD64_ALT },
   2368  9273       Ali 		{ 0x40000000,	MSG_SYS_PWRITE64_ALT },
   2369  9273       Ali 		{ 0x80000000,	MSG_SYS_CREAT64_ALT },
   2370  6635  ab196087 		{ 0,			0 }
   2371  6635  ab196087 	};
   2372  9273       Ali 	static const Val_desc vda7[] = {	/* System Calls [225 - 256] */
   2373  9273       Ali 		{ 0x00000001,	MSG_SYS_OPEN64_ALT },
   2374  9273       Ali 		{ 0x00000002,	MSG_SYS_RPCSYS_ALT },
   2375  9273       Ali 		{ 0x00000004,	MSG_SYS_ZONE_ALT },
   2376  9273       Ali 		{ 0x00000008,	MSG_SYS_AUTOFSSYS_ALT },
   2377  9273       Ali 		{ 0x00000010,	MSG_SYS_GETCWD_ALT },
   2378  9273       Ali 		{ 0x00000020,	MSG_SYS_SO_SOCKET_ALT },
   2379  9273       Ali 		{ 0x00000040,	MSG_SYS_SO_SOCKETPAIR_ALT },
   2380  9273       Ali 		{ 0x00000080,	MSG_SYS_BIND_ALT },
   2381  9273       Ali 		{ 0x00000100,	MSG_SYS_LISTEN_ALT },
   2382  9273       Ali 		{ 0x00000200,	MSG_SYS_ACCEPT_ALT },
   2383  9273       Ali 		{ 0x00000400,	MSG_SYS_CONNECT_ALT },
   2384  9273       Ali 		{ 0x00000800,	MSG_SYS_SHUTDOWN_ALT },
   2385  9273       Ali 		{ 0x00001000,	MSG_SYS_RECV_ALT },
   2386  9273       Ali 		{ 0x00002000,	MSG_SYS_RECVFROM_ALT },
   2387  9273       Ali 		{ 0x00004000,	MSG_SYS_RECVMSG_ALT },
   2388  9273       Ali 		{ 0x00008000,	MSG_SYS_SEND_ALT },
   2389  9273       Ali 		{ 0x00010000,	MSG_SYS_SENDMSG_ALT },
   2390  9273       Ali 		{ 0x00020000,	MSG_SYS_SENDTO_ALT },
   2391  9273       Ali 		{ 0x00040000,	MSG_SYS_GETPEERNAME_ALT },
   2392  9273       Ali 		{ 0x00080000,	MSG_SYS_GETSOCKNAME_ALT },
   2393  9273       Ali 		{ 0x00100000,	MSG_SYS_GETSOCKOPT_ALT },
   2394  9273       Ali 		{ 0x00200000,	MSG_SYS_SETSOCKOPT_ALT },
   2395  9273       Ali 		{ 0x00400000,	MSG_SYS_SOCKCONFIG_ALT },
   2396  9273       Ali 		{ 0x00800000,	MSG_SYS_NTP_GETTIME_ALT },
   2397  9273       Ali 		{ 0x01000000,	MSG_SYS_NTP_ADJTIME_ALT },
   2398  9273       Ali 		{ 0x02000000,	MSG_SYS_LWP_MUTEX_UNLOCK_ALT },
   2399  9273       Ali 		{ 0x04000000,	MSG_SYS_LWP_MUTEX_TRYLOCK_ALT },
   2400  9273       Ali 		{ 0x08000000,	MSG_SYS_LWP_MUTEX_REGISTER_ALT },
   2401  9273       Ali 		{ 0x10000000,	MSG_SYS_CLADM_ALT },
   2402  9273       Ali 		{ 0x20000000,	MSG_SYS_UUCOPY_ALT },
   2403  9273       Ali 		{ 0x40000000,	MSG_SYS_UMOUNT2_ALT },
   2404  6635  ab196087 		/* 256 (unused) */
   2405  6635  ab196087 		{ 0,		0 }
   2406  6635  ab196087 	};
   2407  9273       Ali 	static const conv_bitmaskset_desc_t bitmask_desc[N_MASK] = {
   2408  6635  ab196087 		{ vda0, 0x00000000 },
   2409  6635  ab196087 		{ vda1, 0x00000000 },
   2410  6635  ab196087 		{ vda2, 0x00000000 },
   2411  6635  ab196087 		{ vda3, 0x00000000 },
   2412  6635  ab196087 		{ vda4, 0x00000000 },
   2413  6635  ab196087 		{ vda5, 0x00000000 },
   2414  6635  ab196087 		{ vda6, 0x00000000 },
   2415  6635  ab196087 		{ vda7, 0x80000000 },
   2416  6635  ab196087 		{ NULL, 0xffffffff },
   2417  6635  ab196087 		{ NULL, 0xffffffff },
   2418  6635  ab196087 		{ NULL, 0xffffffff },
   2419  6635  ab196087 		{ NULL, 0xffffffff },
   2420  6635  ab196087 		{ NULL, 0xffffffff },
   2421  6635  ab196087 		{ NULL, 0xffffffff },
   2422  6635  ab196087 		{ NULL, 0xffffffff },
   2423  6635  ab196087 		{ NULL, 0xffffffff }
   2424  6635  ab196087 	};
   2425  6635  ab196087 
   2426  6635  ab196087 	if (n_mask > N_MASK)
   2427  6635  ab196087 		n_mask = N_MASK;
   2428  6635  ab196087 	return (conv_bitmaskset(maskarr, n_mask, bitmask_desc, fmt_flags,
   2429  6635  ab196087 	    cnote_sysset_buf->buf, CONV_CNOTE_SYSSET_BUFSIZE));
   2430  6635  ab196087 
   2431  6635  ab196087 #undef N_MASK
   2432  6635  ab196087 }
   2433