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