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