xref: /titanic_53/usr/src/uts/common/sys/auxv.h (revision b71d513a362009e7000b3cb6cb82318dfd6c83a0)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
59acbbeafSnn35248  * Common Development and Distribution License (the "License").
69acbbeafSnn35248  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
227c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
237c478bd9Sstevel@tonic-gate 
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate /*
26*b71d513aSedp  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
277c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
287c478bd9Sstevel@tonic-gate  */
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifndef	_SYS_AUXV_H
317c478bd9Sstevel@tonic-gate #define	_SYS_AUXV_H
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.2	*/
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #include <sys/types.h>
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
387c478bd9Sstevel@tonic-gate extern "C" {
397c478bd9Sstevel@tonic-gate #endif
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate #if !defined(_ASM)
427c478bd9Sstevel@tonic-gate typedef struct
437c478bd9Sstevel@tonic-gate {
447c478bd9Sstevel@tonic-gate 	int	a_type;
457c478bd9Sstevel@tonic-gate 	union {
467c478bd9Sstevel@tonic-gate 		long	a_val;
477c478bd9Sstevel@tonic-gate #ifdef __STDC__
487c478bd9Sstevel@tonic-gate 		void	*a_ptr;
497c478bd9Sstevel@tonic-gate #else
507c478bd9Sstevel@tonic-gate 		char	*a_ptr;
517c478bd9Sstevel@tonic-gate #endif
527c478bd9Sstevel@tonic-gate 		void	(*a_fcn)();
537c478bd9Sstevel@tonic-gate 	} a_un;
547c478bd9Sstevel@tonic-gate } auxv_t;
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate typedef struct {
597c478bd9Sstevel@tonic-gate 	int32_t	a_type;
607c478bd9Sstevel@tonic-gate 	union	{
617c478bd9Sstevel@tonic-gate 		int32_t	a_val;
627c478bd9Sstevel@tonic-gate 		caddr32_t a_ptr;
637c478bd9Sstevel@tonic-gate 		caddr32_t a_fcn;
647c478bd9Sstevel@tonic-gate 	} a_un;
657c478bd9Sstevel@tonic-gate } auxv32_t;
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
687c478bd9Sstevel@tonic-gate 
697c478bd9Sstevel@tonic-gate #endif /* _ASM */
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate #define	AT_NULL		0
727c478bd9Sstevel@tonic-gate #define	AT_IGNORE	1
737c478bd9Sstevel@tonic-gate #define	AT_EXECFD	2
747c478bd9Sstevel@tonic-gate #define	AT_PHDR		3	/* &phdr[0] */
757c478bd9Sstevel@tonic-gate #define	AT_PHENT	4	/* sizeof(phdr[0]) */
767c478bd9Sstevel@tonic-gate #define	AT_PHNUM	5	/* # phdr entries */
777c478bd9Sstevel@tonic-gate #define	AT_PAGESZ	6	/* getpagesize(2) */
787c478bd9Sstevel@tonic-gate #define	AT_BASE		7	/* ld.so base addr */
797c478bd9Sstevel@tonic-gate #define	AT_FLAGS	8	/* processor flags */
807c478bd9Sstevel@tonic-gate #define	AT_ENTRY	9	/* a.out entry point */
817c478bd9Sstevel@tonic-gate 
827c478bd9Sstevel@tonic-gate /*
837c478bd9Sstevel@tonic-gate  * These relate to the original PPC ABI document; Linux reused
847c478bd9Sstevel@tonic-gate  * the values for other things (see below), so disambiguation of
857c478bd9Sstevel@tonic-gate  * these values may require additional context in PPC binaries.
867c478bd9Sstevel@tonic-gate  *
877c478bd9Sstevel@tonic-gate  * AT_DCACHEBSIZE	10	smallest data cache block size
887c478bd9Sstevel@tonic-gate  * AT_ICACHEBSIZE	11	smallest instruction cache block size
897c478bd9Sstevel@tonic-gate  * AT_UCACHEBSIZE	12	smallest unified cache block size
907c478bd9Sstevel@tonic-gate  *
917c478bd9Sstevel@tonic-gate  * These are the values from LSB 1.3, the first five are also described
927c478bd9Sstevel@tonic-gate  * in the draft amd64 ABI.
937c478bd9Sstevel@tonic-gate  *
947c478bd9Sstevel@tonic-gate  * At the time of writing, Solaris doesn't place any of these values into
9582e77048Seh208807  * the aux vector, except AT_CLKTCK which is placed on the aux vector for
9682e77048Seh208807  * lx branded processes; also, we do similar things via AT_SUN_ values.
977c478bd9Sstevel@tonic-gate  *
987c478bd9Sstevel@tonic-gate  * AT_NOTELF		10	program is not ELF?
997c478bd9Sstevel@tonic-gate  * AT_UID		11	real user id
1007c478bd9Sstevel@tonic-gate  * AT_EUID		12	effective user id
1017c478bd9Sstevel@tonic-gate  * AT_GID		13	real group id
1027c478bd9Sstevel@tonic-gate  * AT_EGID		14	effective group id
1037c478bd9Sstevel@tonic-gate  *
1047c478bd9Sstevel@tonic-gate  * AT_PLATFORM		15
1057c478bd9Sstevel@tonic-gate  * AT_HWCAP		16
1067c478bd9Sstevel@tonic-gate  * AT_CLKTCK		17	c.f. _SC_CLK_TCK
1077c478bd9Sstevel@tonic-gate  * AT_FPUCW		18
1087c478bd9Sstevel@tonic-gate  *
1097c478bd9Sstevel@tonic-gate  * AT_DCACHEBSIZE	19	(moved from 10)
1107c478bd9Sstevel@tonic-gate  * AT_ICACHEBSIZE	20	(moved from 11)
1117c478bd9Sstevel@tonic-gate  * AT_UCACHEBSIZE	21	(moved from 12)
1127c478bd9Sstevel@tonic-gate  *
1137c478bd9Sstevel@tonic-gate  * AT_IGNOREPPC		22
1147c478bd9Sstevel@tonic-gate  */
1157c478bd9Sstevel@tonic-gate 
1167c478bd9Sstevel@tonic-gate /*
1177c478bd9Sstevel@tonic-gate  * Sun extensions begin here
1187c478bd9Sstevel@tonic-gate  */
1197c478bd9Sstevel@tonic-gate #define	AT_SUN_UID	2000	/* effective user id */
1207c478bd9Sstevel@tonic-gate #define	AT_SUN_RUID	2001	/* real user id */
1217c478bd9Sstevel@tonic-gate #define	AT_SUN_GID	2002	/* effective group id */
1227c478bd9Sstevel@tonic-gate #define	AT_SUN_RGID	2003	/* real group id */
1237c478bd9Sstevel@tonic-gate 
1247c478bd9Sstevel@tonic-gate /*
1257c478bd9Sstevel@tonic-gate  * The following attributes are specific to the
1267c478bd9Sstevel@tonic-gate  * kernel implementation of the linker/loader.
1277c478bd9Sstevel@tonic-gate  */
1287c478bd9Sstevel@tonic-gate #define	AT_SUN_LDELF	2004	/* dynamic linker's ELF header */
1297c478bd9Sstevel@tonic-gate #define	AT_SUN_LDSHDR	2005	/* dynamic linker's section headers */
1307c478bd9Sstevel@tonic-gate #define	AT_SUN_LDNAME	2006	/* name of dynamic linker */
1317c478bd9Sstevel@tonic-gate #define	AT_SUN_LPAGESZ	2007	/* large pagesize */
1327c478bd9Sstevel@tonic-gate /*
1337c478bd9Sstevel@tonic-gate  * The following aux vector provides a null-terminated platform
1347c478bd9Sstevel@tonic-gate  * identification string. This information is the same as provided
1357c478bd9Sstevel@tonic-gate  * by sysinfo(2) when invoked with the command SI_PLATFORM.
1367c478bd9Sstevel@tonic-gate  */
1377c478bd9Sstevel@tonic-gate #define	AT_SUN_PLATFORM	2008	/* platform name */
1387c478bd9Sstevel@tonic-gate 
1397c478bd9Sstevel@tonic-gate /*
1407c478bd9Sstevel@tonic-gate  * These attributes communicate performance -hints- about processor
1417c478bd9Sstevel@tonic-gate  * hardware capabilities that might be useful to library implementations.
1427c478bd9Sstevel@tonic-gate  */
1437c478bd9Sstevel@tonic-gate #define	AT_SUN_HWCAP	2009
1447c478bd9Sstevel@tonic-gate 
1457c478bd9Sstevel@tonic-gate #if defined(_KERNEL)
1467c478bd9Sstevel@tonic-gate /*
1477c478bd9Sstevel@tonic-gate  * User info regarding machine attributes, respectively reported to native and
1487c478bd9Sstevel@tonic-gate  * non-native user apps.
1497c478bd9Sstevel@tonic-gate  */
1507c478bd9Sstevel@tonic-gate extern uint_t auxv_hwcap;
1517c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
1527c478bd9Sstevel@tonic-gate extern uint_t auxv_hwcap32;
1537c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
1547c478bd9Sstevel@tonic-gate #else
1557c478bd9Sstevel@tonic-gate extern uint_t getisax(uint32_t *, uint_t);
1567c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
1577c478bd9Sstevel@tonic-gate 
1587c478bd9Sstevel@tonic-gate #define	AT_SUN_IFLUSH	2010	/* flush icache? */
1597c478bd9Sstevel@tonic-gate #define	AT_SUN_CPU	2011	/* cpu name */
1607c478bd9Sstevel@tonic-gate 
1617c478bd9Sstevel@tonic-gate /*
1627c478bd9Sstevel@tonic-gate  * The following aux vector provides a pointer to a null-terminated
1637c478bd9Sstevel@tonic-gate  * path name, a copy of the path name passed to the exec() system
1647c478bd9Sstevel@tonic-gate  * call but that has had all symlinks resolved (see resolvepath(2)).
1657c478bd9Sstevel@tonic-gate  */
1667c478bd9Sstevel@tonic-gate #define	AT_SUN_EXECNAME	2014	/* exec() path name */
1677c478bd9Sstevel@tonic-gate 
1687c478bd9Sstevel@tonic-gate #define	AT_SUN_MMU	2015	/* mmu module name */
1697c478bd9Sstevel@tonic-gate #define	AT_SUN_LDDATA	2016	/* dynamic linkers data segment */
1707c478bd9Sstevel@tonic-gate 
1717c478bd9Sstevel@tonic-gate #define	AT_SUN_AUXFLAGS	2017	/* AF_SUN_ flags passed from the kernel */
1727c478bd9Sstevel@tonic-gate 
1737c478bd9Sstevel@tonic-gate /*
1749acbbeafSnn35248  * Used to indicate to the runtime linker the name of the emulation binary,
1759acbbeafSnn35248  * if one is being used. For brands, this is the name of the brand library.
1769acbbeafSnn35248  */
1779acbbeafSnn35248 #define	AT_SUN_EMULATOR		2018
1789acbbeafSnn35248 
1799acbbeafSnn35248 #define	AT_SUN_BRANDNAME	2019
18007678296Ssl108498 
18107678296Ssl108498 /*
18207678296Ssl108498  * Aux vectors available for brand modules.
18307678296Ssl108498  */
18407678296Ssl108498 #define	AT_SUN_BRAND_AUX1	2020
18507678296Ssl108498 #define	AT_SUN_BRAND_AUX2	2021
18607678296Ssl108498 #define	AT_SUN_BRAND_AUX3	2022
1879acbbeafSnn35248 
1889acbbeafSnn35248 /*
1897c478bd9Sstevel@tonic-gate  * The kernel is in a better position to determine whether a process needs to
1907c478bd9Sstevel@tonic-gate  * ignore dangerous LD environment variables.  If set, this flags tells
1917c478bd9Sstevel@tonic-gate  * ld.so.1 to run "secure" and ignore the the environment.
1927c478bd9Sstevel@tonic-gate  */
1937c478bd9Sstevel@tonic-gate #define	AF_SUN_SETUGID		0x00000001
1947c478bd9Sstevel@tonic-gate 
1957c478bd9Sstevel@tonic-gate /*
1967c478bd9Sstevel@tonic-gate  * If set, this flag indicates that hardware capabilites can be verified
1977c478bd9Sstevel@tonic-gate  * against the AT_SUN_HWCAP value.
1987c478bd9Sstevel@tonic-gate  */
1997c478bd9Sstevel@tonic-gate #define	AF_SUN_HWCAPVERIFY	0x00000002
2007c478bd9Sstevel@tonic-gate 
201*b71d513aSedp /*
202*b71d513aSedp  * If set, this flag indicates that the the linker should not initialize
203*b71d513aSedp  * any of its link maps as primary link wrt the unified libc threading
204*b71d513aSedp  * interfaces.
205*b71d513aSedp  */
206*b71d513aSedp #define	AF_SUN_NOPLM		0x00000004
207*b71d513aSedp 
2087c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
2097c478bd9Sstevel@tonic-gate }
2107c478bd9Sstevel@tonic-gate #endif
2117c478bd9Sstevel@tonic-gate 
2127c478bd9Sstevel@tonic-gate #if defined(_AUXV_TARGET_ALL) || defined(_AUXV_TARGET_SPARC) || defined(__sparc)
2137c478bd9Sstevel@tonic-gate #include <sys/auxv_SPARC.h>
2147c478bd9Sstevel@tonic-gate #endif
2157c478bd9Sstevel@tonic-gate 
2167c478bd9Sstevel@tonic-gate #if defined(_AUXV_TARGET_ALL) || defined(_AUXV_TARGET_386) || defined(__x86)
2177c478bd9Sstevel@tonic-gate #include <sys/auxv_386.h>
2187c478bd9Sstevel@tonic-gate #endif
2197c478bd9Sstevel@tonic-gate 
2207c478bd9Sstevel@tonic-gate #endif	/* _SYS_AUXV_H */
221