]>
Commit | Line | Data |
---|---|---|
a26baf28 BB |
1 | /* |
2 | * CDDL HEADER START | |
3 | * | |
4 | * The contents of this file are subject to the terms of the | |
5 | * Common Development and Distribution License (the "License"). | |
6 | * You may not use this file except in compliance with the License. | |
7 | * | |
8 | * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | |
9 | * or http://www.opensolaris.org/os/licensing. | |
10 | * See the License for the specific language governing permissions | |
11 | * and limitations under the License. | |
12 | * | |
13 | * When distributing Covered Code, include this CDDL HEADER in each | |
14 | * file and include the License file at usr/src/OPENSOLARIS.LICENSE. | |
15 | * If applicable, add the following below this CDDL HEADER, with the | |
16 | * fields enclosed by brackets "[]" replaced with your own identifying | |
17 | * information: Portions Copyright [yyyy] [name of copyright owner] | |
18 | * | |
19 | * CDDL HEADER END | |
20 | */ | |
21 | ||
22 | /* | |
23 | * Copyright 2007 Sun Microsystems, Inc. All rights reserved. | |
24 | * Use is subject to license terms. | |
25 | */ | |
26 | ||
27 | #ifndef _SYS_ISA_DEFS_H | |
28 | #define _SYS_ISA_DEFS_H | |
29 | ||
30 | #ifdef __cplusplus | |
31 | extern "C" { | |
32 | #endif | |
33 | ||
34 | /* x86_64 arch specific defines */ | |
35 | #if defined(__x86_64) || defined(__x86_64__) | |
36 | ||
37 | #if !defined(__x86_64) | |
d1d7e268 | 38 | #define __x86_64 |
a26baf28 BB |
39 | #endif |
40 | ||
41 | #if !defined(__amd64) | |
d1d7e268 | 42 | #define __amd64 |
a26baf28 BB |
43 | #endif |
44 | ||
45 | #if !defined(__x86) | |
d1d7e268 | 46 | #define __x86 |
a26baf28 BB |
47 | #endif |
48 | ||
49 | #if !defined(_LP64) | |
d1d7e268 | 50 | #define _LP64 |
a26baf28 BB |
51 | #endif |
52 | ||
53 | #if !defined(_LITTLE_ENDIAN) | |
d1d7e268 | 54 | #define _LITTLE_ENDIAN |
a26baf28 BB |
55 | #endif |
56 | ||
d1d7e268 | 57 | #define _SUNOS_VTOC_16 |
a26baf28 BB |
58 | |
59 | /* i386 arch specific defines */ | |
60 | #elif defined(__i386) || defined(__i386__) | |
61 | ||
62 | #if !defined(__i386) | |
d1d7e268 | 63 | #define __i386 |
a26baf28 BB |
64 | #endif |
65 | ||
66 | #if !defined(__x86) | |
d1d7e268 | 67 | #define __x86 |
a26baf28 BB |
68 | #endif |
69 | ||
70 | #if !defined(_ILP32) | |
d1d7e268 | 71 | #define _ILP32 |
a26baf28 BB |
72 | #endif |
73 | ||
74 | #if !defined(_LITTLE_ENDIAN) | |
d1d7e268 | 75 | #define _LITTLE_ENDIAN |
a26baf28 BB |
76 | #endif |
77 | ||
d1d7e268 | 78 | #define _SUNOS_VTOC_16 |
a26baf28 BB |
79 | |
80 | /* powerpc arch specific defines */ | |
a22502c9 | 81 | #elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__) |
a26baf28 BB |
82 | |
83 | #if !defined(__powerpc) | |
d1d7e268 | 84 | #define __powerpc |
a26baf28 BB |
85 | #endif |
86 | ||
87 | #if !defined(__powerpc__) | |
d1d7e268 | 88 | #define __powerpc__ |
a26baf28 BB |
89 | #endif |
90 | ||
a22502c9 | 91 | #if defined(__powerpc64__) |
a26baf28 | 92 | #if !defined(_LP64) |
d1d7e268 | 93 | #define _LP64 |
a22502c9 | 94 | #endif |
a26baf28 | 95 | #else |
a22502c9 BB |
96 | #if !defined(_ILP32) |
97 | #define _ILP32 | |
a26baf28 BB |
98 | #endif |
99 | #endif | |
100 | ||
d1d7e268 | 101 | #define _SUNOS_VTOC_16 |
a26baf28 | 102 | |
c4218311 | 103 | /* arm arch specific defines */ |
cdf37f0c | 104 | #elif defined(__arm) || defined(__arm__) || defined(__aarch64__) |
c4218311 JL |
105 | |
106 | #if !defined(__arm) | |
d1d7e268 | 107 | #define __arm |
c4218311 JL |
108 | #endif |
109 | ||
110 | #if !defined(__arm__) | |
d1d7e268 | 111 | #define __arm__ |
c4218311 JL |
112 | #endif |
113 | ||
a22502c9 BB |
114 | #if defined(__aarch64__) |
115 | #if !defined(_LP64) | |
116 | #define _LP64 | |
117 | #endif | |
118 | #else | |
119 | #if !defined(_ILP32) | |
120 | #define _ILP32 | |
121 | #endif | |
122 | #endif | |
123 | ||
cdf37f0c | 124 | #if defined(__ARMEL__) || defined(__AARCH64EL__) |
d1d7e268 | 125 | #define _LITTLE_ENDIAN |
c4218311 | 126 | #else |
d1d7e268 | 127 | #define _BIG_ENDIAN |
c4218311 JL |
128 | #endif |
129 | ||
d1d7e268 | 130 | #define _SUNOS_VTOC_16 |
c4218311 | 131 | |
d7ec8d4f | 132 | /* sparc arch specific defines */ |
a22502c9 | 133 | #elif defined(__sparc) || defined(__sparc__) || defined(__sparc64__) |
d7ec8d4f BB |
134 | |
135 | #if !defined(__sparc) | |
136 | #define __sparc | |
137 | #endif | |
138 | ||
139 | #if !defined(__sparc__) | |
140 | #define __sparc__ | |
141 | #endif | |
142 | ||
143 | #define _BIG_ENDIAN | |
144 | #define _SUNOS_VTOC_16 | |
145 | ||
a22502c9 BB |
146 | #if defined(__sparc64__) |
147 | #if !defined(_LP64) | |
148 | #define _LP64 | |
149 | #endif | |
150 | #else | |
151 | #if !defined(_ILP32) | |
152 | #define _ILP32 | |
d7ec8d4f | 153 | #endif |
d7ec8d4f | 154 | #endif |
d7ec8d4f | 155 | |
a1bc34c0 DJL |
156 | /* s390 arch specific defines */ |
157 | #elif defined(__s390__) | |
158 | #if defined(__s390x__) | |
159 | #if !defined(_LP64) | |
160 | #define _LP64 | |
161 | #endif | |
162 | #else | |
163 | #if !defined(_ILP32) | |
164 | #define _ILP32 | |
165 | #endif | |
166 | #endif | |
167 | ||
168 | #define _BIG_ENDIAN | |
169 | #define _SUNOS_VTOC_16 | |
170 | ||
2493dca5 YS |
171 | /* MIPS arch specific defines */ |
172 | #elif defined(__mips__) | |
173 | ||
174 | #if defined(__MIPSEB__) | |
175 | #define _BIG_ENDIAN | |
176 | #elif defined(__MIPSEL__) | |
177 | #define _LITTLE_ENDIAN | |
178 | #else | |
179 | #error MIPS no endian specified | |
180 | #endif | |
181 | ||
182 | #ifndef _LP64 | |
183 | #define _ILP32 | |
184 | #endif | |
185 | ||
186 | #define _SUNOS_VTOC_16 | |
187 | ||
188 | #else | |
189 | /* | |
190 | * Currently supported: | |
191 | * x86_64, i386, arm, powerpc, s390, sparc, and mips | |
192 | */ | |
a26baf28 BB |
193 | #error "Unsupported ISA type" |
194 | #endif | |
195 | ||
196 | #if defined(_ILP32) && defined(_LP64) | |
197 | #error "Both _ILP32 and _LP64 are defined" | |
198 | #endif | |
199 | ||
a22502c9 BB |
200 | #if !defined(_ILP32) && !defined(_LP64) |
201 | #error "Neither _ILP32 or _LP64 are defined" | |
202 | #endif | |
203 | ||
a26baf28 BB |
204 | #if defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN) |
205 | #error "Both _LITTLE_ENDIAN and _BIG_ENDIAN are defined" | |
206 | #endif | |
207 | ||
208 | #if !defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) | |
209 | #error "Neither _LITTLE_ENDIAN nor _BIG_ENDIAN are defined" | |
210 | #endif | |
211 | ||
212 | #ifdef __cplusplus | |
213 | } | |
214 | #endif | |
215 | ||
216 | #endif /* _SYS_ISA_DEFS_H */ |