1 /** 2 * D header file for GNU/Linux. 3 * 4 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) 5 * Authors: Kai Nacke 6 */ 7 module core.sys.linux.sys.auxv; 8 9 import core.stdc.config; 10 11 version (linux): 12 extern (C): 13 14 version (MIPS32) version = MIPS_Any; 15 version (MIPS64) version = MIPS_Any; 16 version (LoongArch64) version = LoongArch_Any; 17 version (PPC) version = PPC_Any; 18 version (PPC64) version = PPC_Any; 19 version (S390) version = IBMZ_Any; 20 version (SPARC) version = SPARC_Any; 21 version (SPARC64) version = SPARC_Any; 22 version (SystemZ) version = IBMZ_Any; 23 24 c_ulong getauxval(c_ulong type) nothrow pure @nogc @system; 25 26 version (ARM) 27 { 28 // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/arm/bits/hwcap.h 29 30 enum HWCAP_ARM_SWP = 1; 31 enum HWCAP_ARM_HALF = 2; 32 enum HWCAP_ARM_THUMB = 4; 33 enum HWCAP_ARM_26BIT = 8; 34 enum HWCAP_ARM_FAST_MULT = 16; 35 enum HWCAP_ARM_FPA = 32; 36 enum HWCAP_ARM_VFP = 64; 37 enum HWCAP_ARM_EDSP = 128; 38 enum HWCAP_ARM_JAVA = 256; 39 enum HWCAP_ARM_IWMMXT = 512; 40 enum HWCAP_ARM_CRUNCH = 1024; 41 enum HWCAP_ARM_THUMBEE = 2048; 42 enum HWCAP_ARM_NEON = 4096; 43 enum HWCAP_ARM_VFPv3 = 8192; 44 enum HWCAP_ARM_VFPv3D16 = 16384; 45 enum HWCAP_ARM_TLS = 32768; 46 enum HWCAP_ARM_VFPv4 = 65536; 47 enum HWCAP_ARM_IDIVA = 131072; 48 enum HWCAP_ARM_IDIVT = 262144; 49 enum HWCAP_ARM_VFPD32 = 524288; 50 enum HWCAP_ARM_LPAE = 1048576; 51 enum HWCAP_ARM_EVTSTRM = 2097152; 52 } 53 else version (AArch64) 54 { 55 // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h 56 57 enum HWCAP_FP = 1; 58 enum HWCAP_ASIMD = 2; 59 enum HWCAP_EVTSTRM = 4; 60 enum HWCAP_AES = 8; 61 enum HWCAP_PMULL = 16; 62 enum HWCAP_SHA1 = 32; 63 enum HWCAP_SHA2 = 64; 64 enum HWCAP_CRC32 = 128; 65 enum HWCAP_ATOMICS = 256; 66 enum HWCAP_FPHP = 512; 67 enum HWCAP_ASIMDHP = 1024; 68 } 69 else version (PPC_Any) 70 { 71 // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/powerpc/bits/hwcap.h 72 73 enum PPC_FEATURE_32 = 0x80000000; 74 enum PPC_FEATURE_64 = 0x40000000; 75 enum PPC_FEATURE_601_INSTR = 0x20000000; 76 enum PPC_FEATURE_HAS_ALTIVEC = 0x10000000; 77 enum PPC_FEATURE_HAS_FPU = 0x08000000; 78 enum PPC_FEATURE_HAS_MMU = 0x04000000; 79 enum PPC_FEATURE_HAS_4xxMAC = 0x02000000; 80 enum PPC_FEATURE_UNIFIED_CACHE = 0x01000000; 81 enum PPC_FEATURE_HAS_SPE = 0x00800000; 82 enum PPC_FEATURE_HAS_EFP_SINGLE = 0x00400000; 83 enum PPC_FEATURE_HAS_EFP_DOUBLE = 0x00200000; 84 enum PPC_FEATURE_NO_TB = 0x00100000; 85 enum PPC_FEATURE_POWER4 = 0x00080000; 86 enum PPC_FEATURE_POWER5 = 0x00040000; 87 enum PPC_FEATURE_POWER5_PLUS = 0x00020000; 88 enum PPC_FEATURE_CELL_BE = 0x00010000; 89 enum PPC_FEATURE_BOOKE = 0x00008000; 90 enum PPC_FEATURE_SMT = 0x00004000; 91 92 enum PPC_FEATURE_ICACHE_SNOOP = 0x00002000; 93 enum PPC_FEATURE_ARCH_2_05 = 0x00001000; 94 enum PPC_FEATURE_PA6T = 0x00000800; 95 enum PPC_FEATURE_HAS_DFP = 0x00000400; 96 enum PPC_FEATURE_POWER6_EXT = 0x00000200; 97 enum PPC_FEATURE_ARCH_2_06 = 0x00000100; 98 enum PPC_FEATURE_HAS_VSX = 0x00000080; 99 enum PPC_FEATURE_PSERIES_PERFMON_COMPAT = 0x00000040; 100 enum PPC_FEATURE_TRUE_LE = 0x00000002; 101 enum PPC_FEATURE_PPC_LE = 0x00000001; 102 103 enum PPC_FEATURE2_ARCH_2_07 = 0x80000000; 104 enum PPC_FEATURE2_HAS_HTM = 0x40000000; 105 enum PPC_FEATURE2_HAS_DSCR = 0x20000000; 106 enum PPC_FEATURE2_HAS_EBB = 0x10000000; 107 enum PPC_FEATURE2_HAS_ISEL = 0x08000000; 108 enum PPC_FEATURE2_HAS_TAR = 0x04000000; 109 enum PPC_FEATURE2_HAS_VEC_CRYPTO = 0x02000000; 110 } 111 else version (SPARC_Any) 112 { 113 // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/sparc/bits/hwcap.h 114 115 enum HWCAP_SPARC_FLUSH = 0x00000001; 116 enum HWCAP_SPARC_STBAR = 0x00000002; 117 enum HWCAP_SPARC_SWAP = 0x00000004; 118 enum HWCAP_SPARC_MULDIV = 0x00000008; 119 enum HWCAP_SPARC_V9 = 0x00000010; 120 enum HWCAP_SPARC_ULTRA3 = 0x00000020; 121 enum HWCAP_SPARC_BLKINIT = 0x00000040; 122 enum HWCAP_SPARC_N2 = 0x00000080; 123 enum HWCAP_SPARC_MUL32 = 0x00000100; 124 enum HWCAP_SPARC_DIV32 = 0x00000200; 125 enum HWCAP_SPARC_FSMULD = 0x00000400; 126 enum HWCAP_SPARC_V8PLUS = 0x00000800; 127 enum HWCAP_SPARC_POPC = 0x00001000; 128 enum HWCAP_SPARC_VIS = 0x00002000; 129 enum HWCAP_SPARC_VIS2 = 0x00004000; 130 enum HWCAP_SPARC_ASI_BLK_INIT = 0x00008000; 131 enum HWCAP_SPARC_FMAF = 0x00010000; 132 enum HWCAP_SPARC_VIS3 = 0x00020000; 133 enum HWCAP_SPARC_HPC = 0x00040000; 134 enum HWCAP_SPARC_RANDOM = 0x00080000; 135 enum HWCAP_SPARC_TRANS = 0x00100000; 136 enum HWCAP_SPARC_FJFMAU = 0x00200000; 137 enum HWCAP_SPARC_IMA = 0x00400000; 138 enum HWCAP_SPARC_ASI_CACHE_SPARING = 0x00800000; 139 enum HWCAP_SPARC_PAUSE = 0x01000000; 140 enum HWCAP_SPARC_CBCOND = 0x02000000; 141 enum HWCAP_SPARC_CRYPTO = 0x04000000; 142 } 143 else version (IBMZ_Any) 144 { 145 // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/s390/bits/hwcap.h 146 147 enum HWCAP_S390_ESAN3 = 1; 148 enum HWCAP_S390_ZARCH = 2; 149 enum HWCAP_S390_STFLE = 4; 150 enum HWCAP_S390_MSA = 8; 151 enum HWCAP_S390_LDISP = 16; 152 enum HWCAP_S390_EIMM = 32; 153 enum HWCAP_S390_DFP = 64; 154 enum HWCAP_S390_HPAGE = 128; 155 enum HWCAP_S390_ETF3EH = 256; 156 enum HWCAP_S390_HIGH_GPRS = 512; 157 enum HWCAP_S390_TE = 1024; 158 enum HWCAP_S390_VX = 2048; 159 } 160 else version (LoongArch_Any) 161 { 162 enum HWCAP_LOONGARCH_CPUCFG = 0x00000001; 163 enum HWCAP_LOONGARCH_LAM = 0x00000002; 164 enum HWCAP_LOONGARCH_UAL = 0x00000004; 165 enum HWCAP_LOONGARCH_FPU = 0x00000008; 166 enum HWCAP_LOONGARCH_LSX = 0x00000010; 167 enum HWCAP_LOONGARCH_LASX = 0x00000020; 168 enum HWCAP_LOONGARCH_CRC32 = 0x00000040; 169 enum HWCAP_LOONGARCH_COMPLEX = 0x00000080; 170 enum HWCAP_LOONGARCH_CRYPTO = 0x00000100; 171 enum HWCAP_LOONGARCH_LVZ = 0x00000200; 172 enum HWCAP_LOONGARCH_LBT_X86 = 0x00000400; 173 enum HWCAP_LOONGARCH_LBT_ARM = 0x00000800; 174 enum HWCAP_LOONGARCH_LBT_MIPS = 0x00001000; 175 }