1 /* @(#)archdefs.h 1.14 13/07/23 Copyright 2006-2013 J. Schilling */ 2 /* 3 * Processor, instruction set and OS architecture specific defines. 4 * The information is fetched from compiler predefinitions only. 5 * 6 * Copyright (c) 2006-2013 J. Schilling 7 */ 8 /* 9 * The contents of this file are subject to the terms of the 10 * Common Development and Distribution License, Version 1.0 only 11 * (the "License"). You may not use this file except in compliance 12 * with the License. 13 * 14 * See the file CDDL.Schily.txt in this distribution for details. 15 * A copy of the CDDL is also available via the Internet at 16 * http://www.opensource.org/licenses/cddl1.txt 17 * 18 * When distributing Covered Code, include this CDDL HEADER in each 19 * file and include the License file CDDL.Schily.txt from this distribution. 20 */ 21 22 #ifndef _SCHILY_ARCHDEFS_H 23 #define _SCHILY_ARCHDEFS_H 24 25 /* 26 * The code in this file only depends on compiler predefined macros. 27 * For this reason, it does not need to include schily/mconfig.h 28 */ 29 30 #if defined(sun) || defined(__sun) || defined(__sun__) 31 #ifndef __sun 32 #define __sun 33 #endif 34 #endif 35 36 #if defined(sun2) 37 #ifndef __mc68010 38 #define __mc68010 39 #endif 40 #endif 41 42 #if defined(mc68020) || defined(__mc68020) || defined(sun3) 43 #ifndef __mc68020 44 #define __mc68020 45 #endif 46 #endif 47 48 #if defined(__mc68010) || defined(__mc68020) 49 #ifndef __mc68000 50 #define __mc68000 51 #endif 52 #endif 53 54 #if defined(i386) || defined(__i386) || defined(__i386__) || defined(_M_IX86) 55 #ifndef __i386 56 #define __i386 57 #endif 58 #endif 59 60 #if defined(__amd64) || defined(__amd64__) || \ 61 defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) 62 #ifndef __amd64 63 #define __amd64 64 #endif 65 #endif 66 67 #if defined(__i386) || defined(__amd64) 68 #ifndef __x86 69 #define __x86 70 #endif 71 #endif 72 73 #if defined(sparc) || defined(__sparc) || defined(__sparc__) 74 #ifndef __sparc 75 #define __sparc 76 #endif 77 #endif 78 79 #if defined(__sparcv9) || defined(__sparcv9__) 80 #ifndef __sparc 81 #define __sparc 82 #endif 83 #ifndef __sparcv9 84 #define __sparcv9 85 #endif 86 #endif 87 88 #if defined(__sparc) && defined(__arch64__) 89 #ifndef __sparcv9 90 #define __sparcv9 91 #endif 92 #endif 93 94 #if defined(SOL2) || defined(SOL2) || \ 95 defined(S5R4) || defined(__S5R4) || defined(SVR4) 96 # ifndef __SVR4 97 # define __SVR4 98 # endif 99 #endif 100 101 #if defined(sun2) || defined(sun3) || defined(__sun) 102 #ifndef __sun 103 #define __sun 104 #endif 105 #ifndef __GNUC__ 106 #ifndef __SUNPRO_C 107 #ifdef __SVR4 108 #define __SUNPRO_C 109 #else 110 #define __SUN_C 111 #endif /* __SVR4 */ 112 #endif /* !__SUNPRO_C */ 113 #endif /* !__GNUC__ */ 114 #endif /* __sun */ 115 116 117 /* 118 * SunOS 4 specific defines 119 */ 120 #if defined(__sun) && !defined(__SVR4) 121 122 #define __SUNOS4 123 124 #if defined(__mc68000) 125 #define __SUNOS4_MC68000 126 #ifdef __GNUC__ 127 #define __SUNOS4_MC68000_GCC32 128 #define __JS_ARCH_DEFINED 129 #endif 130 #ifdef __SUN_C 131 #define __SUNOS4_MC68000_CC32 132 #define __JS_ARCH_DEFINED 133 #endif 134 #endif /* __mc68000 */ 135 136 #if defined(__sparc) 137 #define __SUNOS4_SPARC 138 #ifdef __GNUC__ 139 #define __SUNOS4_SPARC_GCC32 140 #define __JS_ARCH_DEFINED 141 #endif 142 #if defined(__SUN_C) || defined(__SUNPRO_C) 143 #define __SUNOS4_SPARC_CC32 144 #define __JS_ARCH_DEFINED 145 #endif 146 #endif /* __sparc */ 147 148 #endif /* SunOS 4 */ 149 150 151 /* 152 * SunOS 5 specific defines 153 */ 154 #if defined(__sun) && defined(__SVR4) 155 156 #define __SUNOS5 157 158 #if defined(__sparc) 159 #ifdef __GNUC__ 160 #ifdef __sparcv9 161 #define __SUNOS5_SPARC_GCC64 162 #else 163 #define __SUNOS5_SPARC_GCC32 164 #endif 165 #define __JS_ARCH_DEFINED 166 #endif 167 #if defined(__SUNPRO_C) 168 #ifdef __sparcv9 169 #define __SUNOS5_SPARC_CC64 170 #else 171 #define __SUNOS5_SPARC_CC32 172 #endif 173 #define __JS_ARCH_DEFINED 174 #endif 175 #endif /* __sparc */ 176 177 #if defined(__x86) 178 #ifdef __GNUC__ 179 #ifdef __amd64 180 #define __SUNOS5_X86_GCC64 181 #else 182 #define __SUNOS5_X86_GCC32 183 #endif 184 #define __JS_ARCH_DEFINED 185 #endif 186 #if defined(__SUNPRO_C) 187 #ifdef __amd64 188 #define __SUNOS5_X86_CC64 189 #else 190 #define __SUNOS5_X86_CC32 191 #endif 192 #define __JS_ARCH_DEFINED 193 #endif 194 #endif /* __x86 */ 195 196 #endif /* SunOS 5 */ 197 198 /* 199 * HP-UX specific defines 200 */ 201 #if defined(__hpux) 202 203 #if defined(__hppa) 204 #ifdef __GNUC__ 205 #ifdef __LP64__ /* This may be wrong! */ 206 #define __HPUX_HPPA_GCC64 207 #else 208 #define __HPUX_HPPA_GCC32 209 #endif 210 #define __JS_ARCH_DEFINED 211 #endif 212 #if !defined(__GNUC__) 213 #ifdef __LP64__ 214 #define __HPUX_HPPA_CC64 215 #else 216 #define __HPUX_HPPA_CC32 217 #endif 218 #define __JS_ARCH_DEFINED 219 #endif 220 #endif /* __hppa */ 221 222 #endif /* HP-UX */ 223 224 /* 225 * Linux specific defines 226 */ 227 #if defined(__linux) 228 229 #if defined(__arm__) 230 #ifdef __GNUC__ 231 #ifdef __ARM_ARCH_5TE__ 232 #define __LINUX_ARMV5TEJL_GCC32 233 #define __JS_ARCH_DEFINED 234 #endif 235 #ifndef __JS_ARCH_DEFINED 236 #ifdef __ARM_ARCH_6__ 237 #define __LINUX_ARMV6L_GCC32 238 #define __JS_ARCH_DEFINED 239 #endif 240 #endif 241 #ifndef __JS_ARCH_DEFINED 242 #ifdef __ARM_ARCH_5__ 243 #define __LINUX_ARMV5L_GCC32 244 #define __JS_ARCH_DEFINED 245 #endif 246 #endif 247 #endif /* __GNUC__ */ 248 #endif /* __arm__ */ 249 250 #if defined(__i386__) || defined(i386) 251 #ifdef __GNUC__ 252 #define __LINUX_I386_GCC32 253 #define __JS_ARCH_DEFINED 254 #endif 255 #endif /* __i386__ */ 256 #if defined(__amd64__) || defined(__amd64) 257 #ifdef __GNUC__ 258 #define __LINUX_amd64_GCC64 259 #define __JS_ARCH_DEFINED 260 #endif 261 #endif /* __amd64__ */ 262 263 #endif /* Linux */ 264 265 /* 266 * MS-WIN specific defines 267 * 268 * cl defines one of: 269 * _M_ALPHA 270 * _M_IX86 271 * _M_AMD64 272 * _M_M68K 273 * _M_PPC PPC in general 274 * _M_MPPC Power Macintosh 275 * _M_MRX000 Mips 276 * _M_IA64 Itanium 277 */ 278 #if defined(_MSC_VER) && (defined(_X86_) || defined(_M_IX86)) 279 #define __MSWIN_X86_CL32 280 #define __JS_ARCH_DEFINED 281 #endif 282 283 #if defined(__CYGWIN32__) || defined(__CYGWIN__) 284 #define __CYGWIN_X86_GCC 285 #define __JS_ARCH_DEFINED 286 #endif 287 288 #endif /* _SCHILY_ARCHDEFS_H */ 289