PageRenderTime 47ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/usr/src/uts/common/sys/auxv.h

https://github.com/richlowe/illumos-gate
C Header | 220 lines | 84 code | 31 blank | 105 comment | 4 complexity | 5856b7d01f7d6a51522ac8394ff00e27 MD5 | raw file
  1. /*
  2. * CDDL HEADER START
  3. *
  4. * The contents of this file are subject to the terms of the
  5. * Common Development and Distribution License (the "License").
  6. * You may not use this file except in compliance with the License.
  7. *
  8. * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  9. * or http://www.opensolaris.org/os/licensing.
  10. * See the License for the specific language governing permissions
  11. * and limitations under the License.
  12. *
  13. * When distributing Covered Code, include this CDDL HEADER in each
  14. * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15. * If applicable, add the following below this CDDL HEADER, with the
  16. * fields enclosed by brackets "[]" replaced with your own identifying
  17. * information: Portions Copyright [yyyy] [name of copyright owner]
  18. *
  19. * CDDL HEADER END
  20. */
  21. /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  22. /* All Rights Reserved */
  23. /*
  24. * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
  25. * Use is subject to license terms.
  26. */
  27. #ifndef _SYS_AUXV_H
  28. #define _SYS_AUXV_H
  29. #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
  30. #include <sys/types.h>
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. #if !defined(_ASM)
  35. typedef struct
  36. {
  37. int a_type;
  38. union {
  39. long a_val;
  40. #ifdef __STDC__
  41. void *a_ptr;
  42. #else
  43. char *a_ptr;
  44. #endif
  45. void (*a_fcn)();
  46. } a_un;
  47. } auxv_t;
  48. #if defined(_SYSCALL32)
  49. typedef struct {
  50. int32_t a_type;
  51. union {
  52. int32_t a_val;
  53. caddr32_t a_ptr;
  54. caddr32_t a_fcn;
  55. } a_un;
  56. } auxv32_t;
  57. #endif /* _SYSCALL32 */
  58. #endif /* _ASM */
  59. #define AT_NULL 0
  60. #define AT_IGNORE 1
  61. #define AT_EXECFD 2
  62. #define AT_PHDR 3 /* &phdr[0] */
  63. #define AT_PHENT 4 /* sizeof(phdr[0]) */
  64. #define AT_PHNUM 5 /* # phdr entries */
  65. #define AT_PAGESZ 6 /* getpagesize(2) */
  66. #define AT_BASE 7 /* ld.so base addr */
  67. #define AT_FLAGS 8 /* processor flags */
  68. #define AT_ENTRY 9 /* a.out entry point */
  69. /*
  70. * These relate to the original PPC ABI document; Linux reused
  71. * the values for other things (see below), so disambiguation of
  72. * these values may require additional context in PPC binaries.
  73. *
  74. * AT_DCACHEBSIZE 10 smallest data cache block size
  75. * AT_ICACHEBSIZE 11 smallest instruction cache block size
  76. * AT_UCACHEBSIZE 12 smallest unified cache block size
  77. *
  78. * These are the values from LSB 1.3, the first five are also described
  79. * in the draft amd64 ABI.
  80. *
  81. * At the time of writing, Solaris doesn't place any of these values into
  82. * the aux vector, except AT_CLKTCK which is placed on the aux vector for
  83. * lx branded processes; also, we do similar things via AT_SUN_ values.
  84. *
  85. * AT_NOTELF 10 program is not ELF?
  86. * AT_UID 11 real user id
  87. * AT_EUID 12 effective user id
  88. * AT_GID 13 real group id
  89. * AT_EGID 14 effective group id
  90. *
  91. * AT_PLATFORM 15
  92. * AT_HWCAP 16
  93. * AT_CLKTCK 17 c.f. _SC_CLK_TCK
  94. * AT_FPUCW 18
  95. *
  96. * AT_DCACHEBSIZE 19 (moved from 10)
  97. * AT_ICACHEBSIZE 20 (moved from 11)
  98. * AT_UCACHEBSIZE 21 (moved from 12)
  99. *
  100. * AT_IGNOREPPC 22
  101. */
  102. /*
  103. * Sun extensions begin here
  104. */
  105. #define AT_SUN_UID 2000 /* effective user id */
  106. #define AT_SUN_RUID 2001 /* real user id */
  107. #define AT_SUN_GID 2002 /* effective group id */
  108. #define AT_SUN_RGID 2003 /* real group id */
  109. /*
  110. * The following attributes are specific to the
  111. * kernel implementation of the linker/loader.
  112. */
  113. #define AT_SUN_LDELF 2004 /* dynamic linker's ELF header */
  114. #define AT_SUN_LDSHDR 2005 /* dynamic linker's section headers */
  115. #define AT_SUN_LDNAME 2006 /* name of dynamic linker */
  116. #define AT_SUN_LPAGESZ 2007 /* large pagesize */
  117. /*
  118. * The following aux vector provides a null-terminated platform
  119. * identification string. This information is the same as provided
  120. * by sysinfo(2) when invoked with the command SI_PLATFORM.
  121. */
  122. #define AT_SUN_PLATFORM 2008 /* platform name */
  123. /*
  124. * These attributes communicate performance -hints- about processor
  125. * hardware capabilities that might be useful to library implementations.
  126. */
  127. #define AT_SUN_HWCAP 2009
  128. #if defined(_KERNEL)
  129. /*
  130. * User info regarding machine attributes, respectively reported to native and
  131. * non-native user apps.
  132. */
  133. extern uint_t auxv_hwcap;
  134. #if defined(_SYSCALL32)
  135. extern uint_t auxv_hwcap32;
  136. #endif /* _SYSCALL32 */
  137. #else
  138. extern uint_t getisax(uint32_t *, uint_t);
  139. #endif /* _KERNEL */
  140. #define AT_SUN_IFLUSH 2010 /* flush icache? */
  141. #define AT_SUN_CPU 2011 /* cpu name */
  142. /*
  143. * The following aux vector provides a pointer to a null-terminated
  144. * path name, a copy of the path name passed to the exec() system
  145. * call but that has had all symlinks resolved (see resolvepath(2)).
  146. */
  147. #define AT_SUN_EXECNAME 2014 /* exec() path name */
  148. #define AT_SUN_MMU 2015 /* mmu module name */
  149. #define AT_SUN_LDDATA 2016 /* dynamic linkers data segment */
  150. #define AT_SUN_AUXFLAGS 2017 /* AF_SUN_ flags passed from the kernel */
  151. /*
  152. * Used to indicate to the runtime linker the name of the emulation binary,
  153. * if one is being used. For brands, this is the name of the brand library.
  154. */
  155. #define AT_SUN_EMULATOR 2018
  156. #define AT_SUN_BRANDNAME 2019
  157. /*
  158. * Aux vectors available for brand modules.
  159. */
  160. #define AT_SUN_BRAND_AUX1 2020
  161. #define AT_SUN_BRAND_AUX2 2021
  162. #define AT_SUN_BRAND_AUX3 2022
  163. /*
  164. * The kernel is in a better position to determine whether a process needs to
  165. * ignore dangerous LD environment variables. If set, this flags tells
  166. * ld.so.1 to run "secure" and ignore the the environment.
  167. */
  168. #define AF_SUN_SETUGID 0x00000001
  169. /*
  170. * If set, this flag indicates that hardware capabilites can be verified
  171. * against the AT_SUN_HWCAP value.
  172. */
  173. #define AF_SUN_HWCAPVERIFY 0x00000002
  174. /*
  175. * If set, this flag indicates that the the linker should not initialize
  176. * any of its link maps as primary link wrt the unified libc threading
  177. * interfaces.
  178. */
  179. #define AF_SUN_NOPLM 0x00000004
  180. #ifdef __cplusplus
  181. }
  182. #endif
  183. #if defined(_AUXV_TARGET_ALL) || defined(_AUXV_TARGET_SPARC) || defined(__sparc)
  184. #include <sys/auxv_SPARC.h>
  185. #endif
  186. #if defined(_AUXV_TARGET_ALL) || defined(_AUXV_TARGET_386) || defined(__x86)
  187. #include <sys/auxv_386.h>
  188. #endif
  189. #endif /* _SYS_AUXV_H */