xref: /titanic_53/usr/src/uts/common/sys/auxv.h (revision ebb8ac078e9265f87093fbb363e8c2cbc6ee13e6)
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 /*
26b71d513aSedp  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
277c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
287c478bd9Sstevel@tonic-gate  */
29*ebb8ac07SRobert Mustacchi /*
30*ebb8ac07SRobert Mustacchi  * Copyright (c) 2012, Joyent, Inc.  All rights reserved.
31*ebb8ac07SRobert Mustacchi  */
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #ifndef	_SYS_AUXV_H
347c478bd9Sstevel@tonic-gate #define	_SYS_AUXV_H
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #include <sys/types.h>
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
397c478bd9Sstevel@tonic-gate extern "C" {
407c478bd9Sstevel@tonic-gate #endif
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate #if !defined(_ASM)
437c478bd9Sstevel@tonic-gate typedef struct
447c478bd9Sstevel@tonic-gate {
457c478bd9Sstevel@tonic-gate 	int	a_type;
467c478bd9Sstevel@tonic-gate 	union {
477c478bd9Sstevel@tonic-gate 		long	a_val;
487c478bd9Sstevel@tonic-gate #ifdef __STDC__
497c478bd9Sstevel@tonic-gate 		void	*a_ptr;
507c478bd9Sstevel@tonic-gate #else
517c478bd9Sstevel@tonic-gate 		char	*a_ptr;
527c478bd9Sstevel@tonic-gate #endif
537c478bd9Sstevel@tonic-gate 		void	(*a_fcn)();
547c478bd9Sstevel@tonic-gate 	} a_un;
557c478bd9Sstevel@tonic-gate } auxv_t;
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate typedef struct {
607c478bd9Sstevel@tonic-gate 	int32_t	a_type;
617c478bd9Sstevel@tonic-gate 	union	{
627c478bd9Sstevel@tonic-gate 		int32_t	a_val;
637c478bd9Sstevel@tonic-gate 		caddr32_t a_ptr;
647c478bd9Sstevel@tonic-gate 		caddr32_t a_fcn;
657c478bd9Sstevel@tonic-gate 	} a_un;
667c478bd9Sstevel@tonic-gate } auxv32_t;
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate #endif /* _ASM */
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate #define	AT_NULL		0
737c478bd9Sstevel@tonic-gate #define	AT_IGNORE	1
747c478bd9Sstevel@tonic-gate #define	AT_EXECFD	2
757c478bd9Sstevel@tonic-gate #define	AT_PHDR		3	/* &phdr[0] */
767c478bd9Sstevel@tonic-gate #define	AT_PHENT	4	/* sizeof(phdr[0]) */
777c478bd9Sstevel@tonic-gate #define	AT_PHNUM	5	/* # phdr entries */
787c478bd9Sstevel@tonic-gate #define	AT_PAGESZ	6	/* getpagesize(2) */
797c478bd9Sstevel@tonic-gate #define	AT_BASE		7	/* ld.so base addr */
807c478bd9Sstevel@tonic-gate #define	AT_FLAGS	8	/* processor flags */
817c478bd9Sstevel@tonic-gate #define	AT_ENTRY	9	/* a.out entry point */
827c478bd9Sstevel@tonic-gate 
837c478bd9Sstevel@tonic-gate /*
847c478bd9Sstevel@tonic-gate  * These relate to the original PPC ABI document; Linux reused
857c478bd9Sstevel@tonic-gate  * the values for other things (see below), so disambiguation of
867c478bd9Sstevel@tonic-gate  * these values may require additional context in PPC binaries.
877c478bd9Sstevel@tonic-gate  *
887c478bd9Sstevel@tonic-gate  * AT_DCACHEBSIZE	10	smallest data cache block size
897c478bd9Sstevel@tonic-gate  * AT_ICACHEBSIZE	11	smallest instruction cache block size
907c478bd9Sstevel@tonic-gate  * AT_UCACHEBSIZE	12	smallest unified cache block size
917c478bd9Sstevel@tonic-gate  *
927c478bd9Sstevel@tonic-gate  * These are the values from LSB 1.3, the first five are also described
937c478bd9Sstevel@tonic-gate  * in the draft amd64 ABI.
947c478bd9Sstevel@tonic-gate  *
957c478bd9Sstevel@tonic-gate  * At the time of writing, Solaris doesn't place any of these values into
9682e77048Seh208807  * the aux vector, except AT_CLKTCK which is placed on the aux vector for
9782e77048Seh208807  * lx branded processes; also, we do similar things via AT_SUN_ values.
987c478bd9Sstevel@tonic-gate  *
997c478bd9Sstevel@tonic-gate  * AT_NOTELF		10	program is not ELF?
1007c478bd9Sstevel@tonic-gate  * AT_UID		11	real user id
1017c478bd9Sstevel@tonic-gate  * AT_EUID		12	effective user id
1027c478bd9Sstevel@tonic-gate  * AT_GID		13	real group id
1037c478bd9Sstevel@tonic-gate  * AT_EGID		14	effective group id
1047c478bd9Sstevel@tonic-gate  *
1057c478bd9Sstevel@tonic-gate  * AT_PLATFORM		15
1067c478bd9Sstevel@tonic-gate  * AT_HWCAP		16
1077c478bd9Sstevel@tonic-gate  * AT_CLKTCK		17	c.f. _SC_CLK_TCK
1087c478bd9Sstevel@tonic-gate  * AT_FPUCW		18
1097c478bd9Sstevel@tonic-gate  *
1107c478bd9Sstevel@tonic-gate  * AT_DCACHEBSIZE	19	(moved from 10)
1117c478bd9Sstevel@tonic-gate  * AT_ICACHEBSIZE	20	(moved from 11)
1127c478bd9Sstevel@tonic-gate  * AT_UCACHEBSIZE	21	(moved from 12)
1137c478bd9Sstevel@tonic-gate  *
1147c478bd9Sstevel@tonic-gate  * AT_IGNOREPPC		22
1157c478bd9Sstevel@tonic-gate  */
1167c478bd9Sstevel@tonic-gate 
1177c478bd9Sstevel@tonic-gate /*
1187c478bd9Sstevel@tonic-gate  * Sun extensions begin here
1197c478bd9Sstevel@tonic-gate  */
1207c478bd9Sstevel@tonic-gate #define	AT_SUN_UID	2000	/* effective user id */
1217c478bd9Sstevel@tonic-gate #define	AT_SUN_RUID	2001	/* real user id */
1227c478bd9Sstevel@tonic-gate #define	AT_SUN_GID	2002	/* effective group id */
1237c478bd9Sstevel@tonic-gate #define	AT_SUN_RGID	2003	/* real group id */
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate /*
1267c478bd9Sstevel@tonic-gate  * The following attributes are specific to the
1277c478bd9Sstevel@tonic-gate  * kernel implementation of the linker/loader.
1287c478bd9Sstevel@tonic-gate  */
1297c478bd9Sstevel@tonic-gate #define	AT_SUN_LDELF	2004	/* dynamic linker's ELF header */
1307c478bd9Sstevel@tonic-gate #define	AT_SUN_LDSHDR	2005	/* dynamic linker's section headers */
1317c478bd9Sstevel@tonic-gate #define	AT_SUN_LDNAME	2006	/* name of dynamic linker */
1327c478bd9Sstevel@tonic-gate #define	AT_SUN_LPAGESZ	2007	/* large pagesize */
1337c478bd9Sstevel@tonic-gate /*
1347c478bd9Sstevel@tonic-gate  * The following aux vector provides a null-terminated platform
1357c478bd9Sstevel@tonic-gate  * identification string. This information is the same as provided
1367c478bd9Sstevel@tonic-gate  * by sysinfo(2) when invoked with the command SI_PLATFORM.
1377c478bd9Sstevel@tonic-gate  */
1387c478bd9Sstevel@tonic-gate #define	AT_SUN_PLATFORM	2008	/* platform name */
1397c478bd9Sstevel@tonic-gate 
1407c478bd9Sstevel@tonic-gate /*
1417c478bd9Sstevel@tonic-gate  * These attributes communicate performance -hints- about processor
1427c478bd9Sstevel@tonic-gate  * hardware capabilities that might be useful to library implementations.
1437c478bd9Sstevel@tonic-gate  */
1447c478bd9Sstevel@tonic-gate #define	AT_SUN_HWCAP	2009
145*ebb8ac07SRobert Mustacchi #define	AT_SUN_HWCAP2	2023
1467c478bd9Sstevel@tonic-gate 
1477c478bd9Sstevel@tonic-gate #if defined(_KERNEL)
1487c478bd9Sstevel@tonic-gate /*
1497c478bd9Sstevel@tonic-gate  * User info regarding machine attributes, respectively reported to native and
1507c478bd9Sstevel@tonic-gate  * non-native user apps.
1517c478bd9Sstevel@tonic-gate  */
1527c478bd9Sstevel@tonic-gate extern uint_t auxv_hwcap;
153*ebb8ac07SRobert Mustacchi extern uint_t auxv_hwcap_2;
1547c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
1557c478bd9Sstevel@tonic-gate extern uint_t auxv_hwcap32;
156*ebb8ac07SRobert Mustacchi extern uint_t auxv_hwcap32_2;
1577c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
1587c478bd9Sstevel@tonic-gate #else
1597c478bd9Sstevel@tonic-gate extern uint_t getisax(uint32_t *, uint_t);
1607c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
1617c478bd9Sstevel@tonic-gate 
1627c478bd9Sstevel@tonic-gate #define	AT_SUN_IFLUSH	2010	/* flush icache? */
1637c478bd9Sstevel@tonic-gate #define	AT_SUN_CPU	2011	/* cpu name */
1647c478bd9Sstevel@tonic-gate 
1657c478bd9Sstevel@tonic-gate /*
1667c478bd9Sstevel@tonic-gate  * The following aux vector provides a pointer to a null-terminated
1677c478bd9Sstevel@tonic-gate  * path name, a copy of the path name passed to the exec() system
1687c478bd9Sstevel@tonic-gate  * call but that has had all symlinks resolved (see resolvepath(2)).
1697c478bd9Sstevel@tonic-gate  */
1707c478bd9Sstevel@tonic-gate #define	AT_SUN_EXECNAME	2014	/* exec() path name */
1717c478bd9Sstevel@tonic-gate 
1727c478bd9Sstevel@tonic-gate #define	AT_SUN_MMU	2015	/* mmu module name */
1737c478bd9Sstevel@tonic-gate #define	AT_SUN_LDDATA	2016	/* dynamic linkers data segment */
1747c478bd9Sstevel@tonic-gate 
1757c478bd9Sstevel@tonic-gate #define	AT_SUN_AUXFLAGS	2017	/* AF_SUN_ flags passed from the kernel */
1767c478bd9Sstevel@tonic-gate 
1777c478bd9Sstevel@tonic-gate /*
1789acbbeafSnn35248  * Used to indicate to the runtime linker the name of the emulation binary,
1799acbbeafSnn35248  * if one is being used. For brands, this is the name of the brand library.
1809acbbeafSnn35248  */
1819acbbeafSnn35248 #define	AT_SUN_EMULATOR		2018
1829acbbeafSnn35248 
1839acbbeafSnn35248 #define	AT_SUN_BRANDNAME	2019
18407678296Ssl108498 
18507678296Ssl108498 /*
18607678296Ssl108498  * Aux vectors available for brand modules.
18707678296Ssl108498  */
18807678296Ssl108498 #define	AT_SUN_BRAND_AUX1	2020
18907678296Ssl108498 #define	AT_SUN_BRAND_AUX2	2021
19007678296Ssl108498 #define	AT_SUN_BRAND_AUX3	2022
1919acbbeafSnn35248 
1929acbbeafSnn35248 /*
193*ebb8ac07SRobert Mustacchi  * Note that 2023 is reserved for the AT_SUN_HWCAP2 word defined above.
194*ebb8ac07SRobert Mustacchi  */
195*ebb8ac07SRobert Mustacchi 
196*ebb8ac07SRobert Mustacchi /*
1977c478bd9Sstevel@tonic-gate  * The kernel is in a better position to determine whether a process needs to
1987c478bd9Sstevel@tonic-gate  * ignore dangerous LD environment variables.  If set, this flags tells
1997c478bd9Sstevel@tonic-gate  * ld.so.1 to run "secure" and ignore the the environment.
2007c478bd9Sstevel@tonic-gate  */
2017c478bd9Sstevel@tonic-gate #define	AF_SUN_SETUGID		0x00000001
2027c478bd9Sstevel@tonic-gate 
2037c478bd9Sstevel@tonic-gate /*
2047c478bd9Sstevel@tonic-gate  * If set, this flag indicates that hardware capabilites can be verified
2057c478bd9Sstevel@tonic-gate  * against the AT_SUN_HWCAP value.
2067c478bd9Sstevel@tonic-gate  */
2077c478bd9Sstevel@tonic-gate #define	AF_SUN_HWCAPVERIFY	0x00000002
2087c478bd9Sstevel@tonic-gate 
209b71d513aSedp /*
210b71d513aSedp  * If set, this flag indicates that the the linker should not initialize
211b71d513aSedp  * any of its link maps as primary link wrt the unified libc threading
212b71d513aSedp  * interfaces.
213b71d513aSedp  */
214b71d513aSedp #define	AF_SUN_NOPLM		0x00000004
215b71d513aSedp 
2167c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
2177c478bd9Sstevel@tonic-gate }
2187c478bd9Sstevel@tonic-gate #endif
2197c478bd9Sstevel@tonic-gate 
2207c478bd9Sstevel@tonic-gate #if defined(_AUXV_TARGET_ALL) || defined(_AUXV_TARGET_SPARC) || defined(__sparc)
2217c478bd9Sstevel@tonic-gate #include <sys/auxv_SPARC.h>
2227c478bd9Sstevel@tonic-gate #endif
2237c478bd9Sstevel@tonic-gate 
2247c478bd9Sstevel@tonic-gate #if defined(_AUXV_TARGET_ALL) || defined(_AUXV_TARGET_386) || defined(__x86)
2257c478bd9Sstevel@tonic-gate #include <sys/auxv_386.h>
2267c478bd9Sstevel@tonic-gate #endif
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate #endif	/* _SYS_AUXV_H */
229