12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  22 /*        All Rights Reserved   */
  23 
  24 
  25 /*
  26  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  27  *
  28  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  29  * Use is subject to license terms.
  30  */
  31 /*
  32  * Copyright (c) 2012, Joyent, Inc.  All rights reserved.
  33  */
  34 
  35 #ifndef _SYS_AUXV_H
  36 #define _SYS_AUXV_H
  37 
  38 #include <sys/types.h>
  39 
  40 #ifdef  __cplusplus
  41 extern "C" {
  42 #endif
  43 
  44 #if !defined(_ASM)
  45 typedef struct
  46 {
  47         int     a_type;
  48         union {
  49                 long    a_val;
  50                 void    *a_ptr;
  51                 void    (*a_fcn)();
  52         } a_un;
 
  61                 caddr32_t a_ptr;
  62                 caddr32_t a_fcn;
  63         } a_un;
  64 } auxv32_t;
  65 
  66 #endif  /* _SYSCALL32 */
  67 
  68 #endif /* _ASM */
  69 
  70 #define AT_NULL         0
  71 #define AT_IGNORE       1
  72 #define AT_EXECFD       2
  73 #define AT_PHDR         3       /* &phdr[0] */
  74 #define AT_PHENT        4       /* sizeof(phdr[0]) */
  75 #define AT_PHNUM        5       /* # phdr entries */
  76 #define AT_PAGESZ       6       /* getpagesize(2) */
  77 #define AT_BASE         7       /* ld.so base addr */
  78 #define AT_FLAGS        8       /* processor flags */
  79 #define AT_ENTRY        9       /* a.out entry point */
  80 
  81 /*
  82  * These relate to the original PPC ABI document; Linux reused
  83  * the values for other things (see below), so disambiguation of
  84  * these values may require additional context in PPC binaries.
  85  *
  86  * AT_DCACHEBSIZE       10      smallest data cache block size
  87  * AT_ICACHEBSIZE       11      smallest instruction cache block size
  88  * AT_UCACHEBSIZE       12      smallest unified cache block size
  89  *
  90  * These are the values from LSB 1.3, the first five are also described
  91  * in the draft amd64 ABI.
  92  *
  93  * At the time of writing, Solaris doesn't place any of these values into
  94  * the aux vector, except AT_CLKTCK which is placed on the aux vector for
  95  * lx branded processes; also, we do similar things via AT_SUN_ values.
  96  *
  97  * AT_NOTELF            10      program is not ELF?
  98  * AT_UID               11      real user id
  99  * AT_EUID              12      effective user id
 100  * AT_GID               13      real group id
 101  * AT_EGID              14      effective group id
 102  *
 103  * AT_PLATFORM          15
 104  * AT_HWCAP             16
 105  * AT_CLKTCK            17      c.f. _SC_CLK_TCK
 106  * AT_FPUCW             18
 107  *
 108  * AT_DCACHEBSIZE       19      (moved from 10)
 109  * AT_ICACHEBSIZE       20      (moved from 11)
 110  * AT_UCACHEBSIZE       21      (moved from 12)
 111  *
 112  * AT_IGNOREPPC         22
 113  */
 114 
 115 /*
 116  * Sun extensions begin here
 117  */
 118 #define AT_SUN_UID      2000    /* effective user id */
 119 #define AT_SUN_RUID     2001    /* real user id */
 120 #define AT_SUN_GID      2002    /* effective group id */
 121 #define AT_SUN_RGID     2003    /* real group id */
 122 
 123 /*
 124  * The following attributes are specific to the
 125  * kernel implementation of the linker/loader.
 126  */
 127 #define AT_SUN_LDELF    2004    /* dynamic linker's ELF header */
 128 #define AT_SUN_LDSHDR   2005    /* dynamic linker's section headers */
 129 #define AT_SUN_LDNAME   2006    /* name of dynamic linker */
 130 #define AT_SUN_LPAGESZ  2007    /* large pagesize */
 131 /*
 132  * The following aux vector provides a null-terminated platform
 
 
 169 
 170 #define AT_SUN_MMU      2015    /* mmu module name */
 171 #define AT_SUN_LDDATA   2016    /* dynamic linkers data segment */
 172 
 173 #define AT_SUN_AUXFLAGS 2017    /* AF_SUN_ flags passed from the kernel */
 174 
 175 /*
 176  * Used to indicate to the runtime linker the name of the emulation binary,
 177  * if one is being used. For brands, this is the name of the brand library.
 178  */
 179 #define AT_SUN_EMULATOR         2018
 180 
 181 #define AT_SUN_BRANDNAME        2019
 182 
 183 /*
 184  * Aux vectors available for brand modules.
 185  */
 186 #define AT_SUN_BRAND_AUX1       2020
 187 #define AT_SUN_BRAND_AUX2       2021
 188 #define AT_SUN_BRAND_AUX3       2022
 189 
 190 /*
 191  * Note that 2023 is reserved for the AT_SUN_HWCAP2 word defined above.
 192  */
 193 
 194 /*
 195  * The kernel is in a better position to determine whether a process needs to
 196  * ignore dangerous LD environment variables.  If set, this flags tells
 197  * ld.so.1 to run "secure" and ignore the the environment.
 198  */
 199 #define AF_SUN_SETUGID          0x00000001
 200 
 201 /*
 202  * If set, this flag indicates that hardware capabilites can be verified
 203  * against the AT_SUN_HWCAP value.
 204  */
 205 #define AF_SUN_HWCAPVERIFY      0x00000002
 206 
 207 /*
 208  * If set, this flag indicates that the the linker should not initialize
 209  * any of its link maps as primary link wrt the unified libc threading
 210  * interfaces.
  | 
 
 
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  22 /*        All Rights Reserved   */
  23 
  24 
  25 /*
  26  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  27  *
  28  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  29  * Use is subject to license terms.
  30  */
  31 /*
  32  * Copyright 2016 Joyent, Inc.
  33  */
  34 
  35 #ifndef _SYS_AUXV_H
  36 #define _SYS_AUXV_H
  37 
  38 #include <sys/types.h>
  39 
  40 #ifdef  __cplusplus
  41 extern "C" {
  42 #endif
  43 
  44 #if !defined(_ASM)
  45 typedef struct
  46 {
  47         int     a_type;
  48         union {
  49                 long    a_val;
  50                 void    *a_ptr;
  51                 void    (*a_fcn)();
  52         } a_un;
 
  61                 caddr32_t a_ptr;
  62                 caddr32_t a_fcn;
  63         } a_un;
  64 } auxv32_t;
  65 
  66 #endif  /* _SYSCALL32 */
  67 
  68 #endif /* _ASM */
  69 
  70 #define AT_NULL         0
  71 #define AT_IGNORE       1
  72 #define AT_EXECFD       2
  73 #define AT_PHDR         3       /* &phdr[0] */
  74 #define AT_PHENT        4       /* sizeof(phdr[0]) */
  75 #define AT_PHNUM        5       /* # phdr entries */
  76 #define AT_PAGESZ       6       /* getpagesize(2) */
  77 #define AT_BASE         7       /* ld.so base addr */
  78 #define AT_FLAGS        8       /* processor flags */
  79 #define AT_ENTRY        9       /* a.out entry point */
  80 
  81 /* First introduced on Linux */
  82 #define AT_RANDOM       25      /* address of 16 random bytes */
  83 
  84 /*
  85  * These relate to the original PPC ABI document; Linux reused
  86  * the values for other things (see below), so disambiguation of
  87  * these values may require additional context in PPC binaries.
  88  *
  89  * AT_DCACHEBSIZE       10      smallest data cache block size
  90  * AT_ICACHEBSIZE       11      smallest instruction cache block size
  91  * AT_UCACHEBSIZE       12      smallest unified cache block size
  92  *
  93  * These are the values from LSB 1.3, the first five are also described
  94  * in the draft amd64 ABI.
  95  *
  96  * At the time of writing, illumos doesn't place any of these values into the
  97  * aux vector, except where noted. We do similar things via AT_SUN_ values.
  98  *
  99  * AT_NOTELF            10      program is not ELF?
 100  * AT_UID               11      real user id (provided in LX)
 101  * AT_EUID              12      effective user id (provided in LX)
 102  * AT_GID               13      real group id (provided in LX)
 103  * AT_EGID              14      effective group id (provided in LX)
 104  *
 105  * AT_PLATFORM          15
 106  * AT_HWCAP             16
 107  * AT_CLKTCK            17      c.f. _SC_CLK_TCK (provided in LX)
 108  * AT_FPUCW             18
 109  *
 110  * AT_DCACHEBSIZE       19      (moved from 10)
 111  * AT_ICACHEBSIZE       20      (moved from 11)
 112  * AT_UCACHEBSIZE       21      (moved from 12)
 113  *
 114  * AT_IGNOREPPC         22
 115  *
 116  * On Linux:
 117  * AT_* values 18 through 22 are reserved
 118  * AT_SECURE            23      secure mode boolean (provided in LX)
 119  * AT_BASE_PLATFORM     24      string identifying real platform, may
 120  *                              differ from AT_PLATFORM.
 121  * AT_HWCAP2            26      extension of AT_HWCAP
 122  * AT_EXECFN            31      filename of program
 123  * AT_SYSINFO           32
 124  * AT_SYSINFO_EHDR      33      The vDSO location
 125  */
 126 
 127 /*
 128  * Sun extensions begin here
 129  */
 130 #define AT_SUN_UID      2000    /* effective user id */
 131 #define AT_SUN_RUID     2001    /* real user id */
 132 #define AT_SUN_GID      2002    /* effective group id */
 133 #define AT_SUN_RGID     2003    /* real group id */
 134 
 135 /*
 136  * The following attributes are specific to the
 137  * kernel implementation of the linker/loader.
 138  */
 139 #define AT_SUN_LDELF    2004    /* dynamic linker's ELF header */
 140 #define AT_SUN_LDSHDR   2005    /* dynamic linker's section headers */
 141 #define AT_SUN_LDNAME   2006    /* name of dynamic linker */
 142 #define AT_SUN_LPAGESZ  2007    /* large pagesize */
 143 /*
 144  * The following aux vector provides a null-terminated platform
 
 
 181 
 182 #define AT_SUN_MMU      2015    /* mmu module name */
 183 #define AT_SUN_LDDATA   2016    /* dynamic linkers data segment */
 184 
 185 #define AT_SUN_AUXFLAGS 2017    /* AF_SUN_ flags passed from the kernel */
 186 
 187 /*
 188  * Used to indicate to the runtime linker the name of the emulation binary,
 189  * if one is being used. For brands, this is the name of the brand library.
 190  */
 191 #define AT_SUN_EMULATOR         2018
 192 
 193 #define AT_SUN_BRANDNAME        2019
 194 
 195 /*
 196  * Aux vectors available for brand modules.
 197  */
 198 #define AT_SUN_BRAND_AUX1       2020
 199 #define AT_SUN_BRAND_AUX2       2021
 200 #define AT_SUN_BRAND_AUX3       2022
 201 #define AT_SUN_BRAND_AUX4       2025
 202 #define AT_SUN_BRAND_NROOT      2024
 203 
 204 /*
 205  * Aux vector for comm page
 206  */
 207 #define AT_SUN_COMMPAGE         2026
 208 
 209 /*
 210  * Note that 2023 is reserved for the AT_SUN_HWCAP2 word defined above.
 211  */
 212 
 213 /*
 214  * The kernel is in a better position to determine whether a process needs to
 215  * ignore dangerous LD environment variables.  If set, this flags tells
 216  * ld.so.1 to run "secure" and ignore the the environment.
 217  */
 218 #define AF_SUN_SETUGID          0x00000001
 219 
 220 /*
 221  * If set, this flag indicates that hardware capabilites can be verified
 222  * against the AT_SUN_HWCAP value.
 223  */
 224 #define AF_SUN_HWCAPVERIFY      0x00000002
 225 
 226 /*
 227  * If set, this flag indicates that the the linker should not initialize
 228  * any of its link maps as primary link wrt the unified libc threading
 229  * interfaces.
  |