10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 52712Snn35248 * Common Development and Distribution License (the "License"). 62712Snn35248 * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 220Sstevel@tonic-gate /* All Rights Reserved */ 230Sstevel@tonic-gate 240Sstevel@tonic-gate 250Sstevel@tonic-gate /* 26*6229Sedp * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 270Sstevel@tonic-gate * Use is subject to license terms. 280Sstevel@tonic-gate */ 290Sstevel@tonic-gate 300Sstevel@tonic-gate #ifndef _SYS_AUXV_H 310Sstevel@tonic-gate #define _SYS_AUXV_H 320Sstevel@tonic-gate 330Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */ 340Sstevel@tonic-gate 350Sstevel@tonic-gate #include <sys/types.h> 360Sstevel@tonic-gate 370Sstevel@tonic-gate #ifdef __cplusplus 380Sstevel@tonic-gate extern "C" { 390Sstevel@tonic-gate #endif 400Sstevel@tonic-gate 410Sstevel@tonic-gate #if !defined(_ASM) 420Sstevel@tonic-gate typedef struct 430Sstevel@tonic-gate { 440Sstevel@tonic-gate int a_type; 450Sstevel@tonic-gate union { 460Sstevel@tonic-gate long a_val; 470Sstevel@tonic-gate #ifdef __STDC__ 480Sstevel@tonic-gate void *a_ptr; 490Sstevel@tonic-gate #else 500Sstevel@tonic-gate char *a_ptr; 510Sstevel@tonic-gate #endif 520Sstevel@tonic-gate void (*a_fcn)(); 530Sstevel@tonic-gate } a_un; 540Sstevel@tonic-gate } auxv_t; 550Sstevel@tonic-gate 560Sstevel@tonic-gate #if defined(_SYSCALL32) 570Sstevel@tonic-gate 580Sstevel@tonic-gate typedef struct { 590Sstevel@tonic-gate int32_t a_type; 600Sstevel@tonic-gate union { 610Sstevel@tonic-gate int32_t a_val; 620Sstevel@tonic-gate caddr32_t a_ptr; 630Sstevel@tonic-gate caddr32_t a_fcn; 640Sstevel@tonic-gate } a_un; 650Sstevel@tonic-gate } auxv32_t; 660Sstevel@tonic-gate 670Sstevel@tonic-gate #endif /* _SYSCALL32 */ 680Sstevel@tonic-gate 690Sstevel@tonic-gate #endif /* _ASM */ 700Sstevel@tonic-gate 710Sstevel@tonic-gate #define AT_NULL 0 720Sstevel@tonic-gate #define AT_IGNORE 1 730Sstevel@tonic-gate #define AT_EXECFD 2 740Sstevel@tonic-gate #define AT_PHDR 3 /* &phdr[0] */ 750Sstevel@tonic-gate #define AT_PHENT 4 /* sizeof(phdr[0]) */ 760Sstevel@tonic-gate #define AT_PHNUM 5 /* # phdr entries */ 770Sstevel@tonic-gate #define AT_PAGESZ 6 /* getpagesize(2) */ 780Sstevel@tonic-gate #define AT_BASE 7 /* ld.so base addr */ 790Sstevel@tonic-gate #define AT_FLAGS 8 /* processor flags */ 800Sstevel@tonic-gate #define AT_ENTRY 9 /* a.out entry point */ 810Sstevel@tonic-gate 820Sstevel@tonic-gate /* 830Sstevel@tonic-gate * These relate to the original PPC ABI document; Linux reused 840Sstevel@tonic-gate * the values for other things (see below), so disambiguation of 850Sstevel@tonic-gate * these values may require additional context in PPC binaries. 860Sstevel@tonic-gate * 870Sstevel@tonic-gate * AT_DCACHEBSIZE 10 smallest data cache block size 880Sstevel@tonic-gate * AT_ICACHEBSIZE 11 smallest instruction cache block size 890Sstevel@tonic-gate * AT_UCACHEBSIZE 12 smallest unified cache block size 900Sstevel@tonic-gate * 910Sstevel@tonic-gate * These are the values from LSB 1.3, the first five are also described 920Sstevel@tonic-gate * in the draft amd64 ABI. 930Sstevel@tonic-gate * 940Sstevel@tonic-gate * At the time of writing, Solaris doesn't place any of these values into 954730Seh208807 * the aux vector, except AT_CLKTCK which is placed on the aux vector for 964730Seh208807 * lx branded processes; also, we do similar things via AT_SUN_ values. 970Sstevel@tonic-gate * 980Sstevel@tonic-gate * AT_NOTELF 10 program is not ELF? 990Sstevel@tonic-gate * AT_UID 11 real user id 1000Sstevel@tonic-gate * AT_EUID 12 effective user id 1010Sstevel@tonic-gate * AT_GID 13 real group id 1020Sstevel@tonic-gate * AT_EGID 14 effective group id 1030Sstevel@tonic-gate * 1040Sstevel@tonic-gate * AT_PLATFORM 15 1050Sstevel@tonic-gate * AT_HWCAP 16 1060Sstevel@tonic-gate * AT_CLKTCK 17 c.f. _SC_CLK_TCK 1070Sstevel@tonic-gate * AT_FPUCW 18 1080Sstevel@tonic-gate * 1090Sstevel@tonic-gate * AT_DCACHEBSIZE 19 (moved from 10) 1100Sstevel@tonic-gate * AT_ICACHEBSIZE 20 (moved from 11) 1110Sstevel@tonic-gate * AT_UCACHEBSIZE 21 (moved from 12) 1120Sstevel@tonic-gate * 1130Sstevel@tonic-gate * AT_IGNOREPPC 22 1140Sstevel@tonic-gate */ 1150Sstevel@tonic-gate 1160Sstevel@tonic-gate /* 1170Sstevel@tonic-gate * Sun extensions begin here 1180Sstevel@tonic-gate */ 1190Sstevel@tonic-gate #define AT_SUN_UID 2000 /* effective user id */ 1200Sstevel@tonic-gate #define AT_SUN_RUID 2001 /* real user id */ 1210Sstevel@tonic-gate #define AT_SUN_GID 2002 /* effective group id */ 1220Sstevel@tonic-gate #define AT_SUN_RGID 2003 /* real group id */ 1230Sstevel@tonic-gate 1240Sstevel@tonic-gate /* 1250Sstevel@tonic-gate * The following attributes are specific to the 1260Sstevel@tonic-gate * kernel implementation of the linker/loader. 1270Sstevel@tonic-gate */ 1280Sstevel@tonic-gate #define AT_SUN_LDELF 2004 /* dynamic linker's ELF header */ 1290Sstevel@tonic-gate #define AT_SUN_LDSHDR 2005 /* dynamic linker's section headers */ 1300Sstevel@tonic-gate #define AT_SUN_LDNAME 2006 /* name of dynamic linker */ 1310Sstevel@tonic-gate #define AT_SUN_LPAGESZ 2007 /* large pagesize */ 1320Sstevel@tonic-gate /* 1330Sstevel@tonic-gate * The following aux vector provides a null-terminated platform 1340Sstevel@tonic-gate * identification string. This information is the same as provided 1350Sstevel@tonic-gate * by sysinfo(2) when invoked with the command SI_PLATFORM. 1360Sstevel@tonic-gate */ 1370Sstevel@tonic-gate #define AT_SUN_PLATFORM 2008 /* platform name */ 1380Sstevel@tonic-gate 1390Sstevel@tonic-gate /* 1400Sstevel@tonic-gate * These attributes communicate performance -hints- about processor 1410Sstevel@tonic-gate * hardware capabilities that might be useful to library implementations. 1420Sstevel@tonic-gate */ 1434730Seh208807 #define AT_SUN_HWCAP 2009 1440Sstevel@tonic-gate 1450Sstevel@tonic-gate #if defined(_KERNEL) 1460Sstevel@tonic-gate /* 1470Sstevel@tonic-gate * User info regarding machine attributes, respectively reported to native and 1480Sstevel@tonic-gate * non-native user apps. 1490Sstevel@tonic-gate */ 1500Sstevel@tonic-gate extern uint_t auxv_hwcap; 1510Sstevel@tonic-gate #if defined(_SYSCALL32) 1520Sstevel@tonic-gate extern uint_t auxv_hwcap32; 1530Sstevel@tonic-gate #endif /* _SYSCALL32 */ 1540Sstevel@tonic-gate #else 1550Sstevel@tonic-gate extern uint_t getisax(uint32_t *, uint_t); 1560Sstevel@tonic-gate #endif /* _KERNEL */ 1570Sstevel@tonic-gate 1580Sstevel@tonic-gate #define AT_SUN_IFLUSH 2010 /* flush icache? */ 1590Sstevel@tonic-gate #define AT_SUN_CPU 2011 /* cpu name */ 1600Sstevel@tonic-gate 1610Sstevel@tonic-gate /* 1620Sstevel@tonic-gate * The following aux vector provides a pointer to a null-terminated 1630Sstevel@tonic-gate * path name, a copy of the path name passed to the exec() system 1640Sstevel@tonic-gate * call but that has had all symlinks resolved (see resolvepath(2)). 1650Sstevel@tonic-gate */ 1660Sstevel@tonic-gate #define AT_SUN_EXECNAME 2014 /* exec() path name */ 1670Sstevel@tonic-gate 1680Sstevel@tonic-gate #define AT_SUN_MMU 2015 /* mmu module name */ 1690Sstevel@tonic-gate #define AT_SUN_LDDATA 2016 /* dynamic linkers data segment */ 1700Sstevel@tonic-gate 1710Sstevel@tonic-gate #define AT_SUN_AUXFLAGS 2017 /* AF_SUN_ flags passed from the kernel */ 1720Sstevel@tonic-gate 1730Sstevel@tonic-gate /* 1742712Snn35248 * Used to indicate to the runtime linker the name of the emulation binary, 1752712Snn35248 * if one is being used. For brands, this is the name of the brand library. 1762712Snn35248 */ 1772712Snn35248 #define AT_SUN_EMULATOR 2018 1782712Snn35248 1792712Snn35248 #define AT_SUN_BRANDNAME 2019 1804642Ssl108498 1814642Ssl108498 /* 1824642Ssl108498 * Aux vectors available for brand modules. 1834642Ssl108498 */ 1844642Ssl108498 #define AT_SUN_BRAND_AUX1 2020 1854642Ssl108498 #define AT_SUN_BRAND_AUX2 2021 1864642Ssl108498 #define AT_SUN_BRAND_AUX3 2022 1872712Snn35248 1882712Snn35248 /* 1890Sstevel@tonic-gate * The kernel is in a better position to determine whether a process needs to 1900Sstevel@tonic-gate * ignore dangerous LD environment variables. If set, this flags tells 1910Sstevel@tonic-gate * ld.so.1 to run "secure" and ignore the the environment. 1920Sstevel@tonic-gate */ 1930Sstevel@tonic-gate #define AF_SUN_SETUGID 0x00000001 1940Sstevel@tonic-gate 1950Sstevel@tonic-gate /* 1960Sstevel@tonic-gate * If set, this flag indicates that hardware capabilites can be verified 1970Sstevel@tonic-gate * against the AT_SUN_HWCAP value. 1980Sstevel@tonic-gate */ 1990Sstevel@tonic-gate #define AF_SUN_HWCAPVERIFY 0x00000002 2000Sstevel@tonic-gate 201*6229Sedp /* 202*6229Sedp * If set, this flag indicates that the the linker should not initialize 203*6229Sedp * any of its link maps as primary link wrt the unified libc threading 204*6229Sedp * interfaces. 205*6229Sedp */ 206*6229Sedp #define AF_SUN_NOPLM 0x00000004 207*6229Sedp 2080Sstevel@tonic-gate #ifdef __cplusplus 2090Sstevel@tonic-gate } 2100Sstevel@tonic-gate #endif 2110Sstevel@tonic-gate 2120Sstevel@tonic-gate #if defined(_AUXV_TARGET_ALL) || defined(_AUXV_TARGET_SPARC) || defined(__sparc) 2130Sstevel@tonic-gate #include <sys/auxv_SPARC.h> 2140Sstevel@tonic-gate #endif 2150Sstevel@tonic-gate 2160Sstevel@tonic-gate #if defined(_AUXV_TARGET_ALL) || defined(_AUXV_TARGET_386) || defined(__x86) 2170Sstevel@tonic-gate #include <sys/auxv_386.h> 2180Sstevel@tonic-gate #endif 2190Sstevel@tonic-gate 2200Sstevel@tonic-gate #endif /* _SYS_AUXV_H */ 221