1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
---|
2 | /* ***** BEGIN LICENSE BLOCK *****
|
---|
3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
---|
4 | *
|
---|
5 | * The contents of this file are subject to the Mozilla Public License Version
|
---|
6 | * 1.1 (the "License"); you may not use this file except in compliance with
|
---|
7 | * the License. You may obtain a copy of the License at
|
---|
8 | * http://www.mozilla.org/MPL/
|
---|
9 | *
|
---|
10 | * Software distributed under the License is distributed on an "AS IS" basis,
|
---|
11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
---|
12 | * for the specific language governing rights and limitations under the
|
---|
13 | * License.
|
---|
14 | *
|
---|
15 | * The Original Code is the Netscape Portable Runtime (NSPR).
|
---|
16 | *
|
---|
17 | * The Initial Developer of the Original Code is
|
---|
18 | * Netscape Communications Corporation.
|
---|
19 | * Portions created by the Initial Developer are Copyright (C) 1998-2000
|
---|
20 | * the Initial Developer. All Rights Reserved.
|
---|
21 | *
|
---|
22 | * Contributor(s):
|
---|
23 | *
|
---|
24 | * Alternatively, the contents of this file may be used under the terms of
|
---|
25 | * either the GNU General Public License Version 2 or later (the "GPL"), or
|
---|
26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
---|
27 | * in which case the provisions of the GPL or the LGPL are applicable instead
|
---|
28 | * of those above. If you wish to allow use of your version of this file only
|
---|
29 | * under the terms of either the GPL or the LGPL, and not to allow others to
|
---|
30 | * use your version of this file under the terms of the MPL, indicate your
|
---|
31 | * decision by deleting the provisions above and replace them with the notice
|
---|
32 | * and other provisions required by the GPL or the LGPL. If you do not delete
|
---|
33 | * the provisions above, a recipient may use your version of this file under
|
---|
34 | * the terms of any one of the MPL, the GPL or the LGPL.
|
---|
35 | *
|
---|
36 | * ***** END LICENSE BLOCK ***** */
|
---|
37 |
|
---|
38 | #ifndef nspr_cpucfg___
|
---|
39 | #define nspr_cpucfg___
|
---|
40 |
|
---|
41 | #ifndef XP_UNIX
|
---|
42 | #define XP_UNIX
|
---|
43 | #endif
|
---|
44 |
|
---|
45 | #ifndef LINUX
|
---|
46 | #define LINUX
|
---|
47 | #endif
|
---|
48 |
|
---|
49 | #define PR_AF_INET6 10 /* same as AF_INET6 */
|
---|
50 |
|
---|
51 | #ifdef __powerpc__
|
---|
52 |
|
---|
53 | #undef IS_LITTLE_ENDIAN
|
---|
54 | #define IS_BIG_ENDIAN 1
|
---|
55 |
|
---|
56 | #define PR_BYTES_PER_BYTE 1
|
---|
57 | #define PR_BYTES_PER_SHORT 2
|
---|
58 | #define PR_BYTES_PER_INT 4
|
---|
59 | #define PR_BYTES_PER_INT64 8
|
---|
60 | #define PR_BYTES_PER_LONG 4
|
---|
61 | #define PR_BYTES_PER_FLOAT 4
|
---|
62 | #define PR_BYTES_PER_DOUBLE 8
|
---|
63 | #define PR_BYTES_PER_WORD 4
|
---|
64 | #define PR_BYTES_PER_DWORD 8
|
---|
65 |
|
---|
66 | #define PR_BITS_PER_BYTE 8
|
---|
67 | #define PR_BITS_PER_SHORT 16
|
---|
68 | #define PR_BITS_PER_INT 32
|
---|
69 | #define PR_BITS_PER_INT64 64
|
---|
70 | #define PR_BITS_PER_LONG 32
|
---|
71 | #define PR_BITS_PER_FLOAT 32
|
---|
72 | #define PR_BITS_PER_DOUBLE 64
|
---|
73 | #define PR_BITS_PER_WORD 32
|
---|
74 |
|
---|
75 | #define PR_BITS_PER_BYTE_LOG2 3
|
---|
76 | #define PR_BITS_PER_SHORT_LOG2 4
|
---|
77 | #define PR_BITS_PER_INT_LOG2 5
|
---|
78 | #define PR_BITS_PER_INT64_LOG2 6
|
---|
79 | #define PR_BITS_PER_LONG_LOG2 5
|
---|
80 | #define PR_BITS_PER_FLOAT_LOG2 5
|
---|
81 | #define PR_BITS_PER_DOUBLE_LOG2 6
|
---|
82 | #define PR_BITS_PER_WORD_LOG2 5
|
---|
83 |
|
---|
84 | #define PR_ALIGN_OF_SHORT 2
|
---|
85 | #define PR_ALIGN_OF_INT 4
|
---|
86 | #define PR_ALIGN_OF_LONG 4
|
---|
87 | #define PR_ALIGN_OF_INT64 8
|
---|
88 | #define PR_ALIGN_OF_FLOAT 4
|
---|
89 | #define PR_ALIGN_OF_DOUBLE 8
|
---|
90 | #define PR_ALIGN_OF_POINTER 4
|
---|
91 | #define PR_ALIGN_OF_WORD 4
|
---|
92 |
|
---|
93 | #define PR_BYTES_PER_WORD_LOG2 2
|
---|
94 | #define PR_BYTES_PER_DWORD_LOG2 3
|
---|
95 |
|
---|
96 | #elif defined(__alpha)
|
---|
97 |
|
---|
98 | #define IS_LITTLE_ENDIAN 1
|
---|
99 | #undef IS_BIG_ENDIAN
|
---|
100 | #define IS_64
|
---|
101 |
|
---|
102 | #define PR_BYTES_PER_BYTE 1
|
---|
103 | #define PR_BYTES_PER_SHORT 2
|
---|
104 | #define PR_BYTES_PER_INT 4
|
---|
105 | #define PR_BYTES_PER_INT64 8
|
---|
106 | #define PR_BYTES_PER_LONG 8
|
---|
107 | #define PR_BYTES_PER_FLOAT 4
|
---|
108 | #define PR_BYTES_PER_DOUBLE 8
|
---|
109 | #define PR_BYTES_PER_WORD 8
|
---|
110 | #define PR_BYTES_PER_DWORD 8
|
---|
111 |
|
---|
112 | #define PR_BITS_PER_BYTE 8
|
---|
113 | #define PR_BITS_PER_SHORT 16
|
---|
114 | #define PR_BITS_PER_INT 32
|
---|
115 | #define PR_BITS_PER_INT64 64
|
---|
116 | #define PR_BITS_PER_LONG 64
|
---|
117 | #define PR_BITS_PER_FLOAT 32
|
---|
118 | #define PR_BITS_PER_DOUBLE 64
|
---|
119 | #define PR_BITS_PER_WORD 64
|
---|
120 |
|
---|
121 | #define PR_BITS_PER_BYTE_LOG2 3
|
---|
122 | #define PR_BITS_PER_SHORT_LOG2 4
|
---|
123 | #define PR_BITS_PER_INT_LOG2 5
|
---|
124 | #define PR_BITS_PER_INT64_LOG2 6
|
---|
125 | #define PR_BITS_PER_LONG_LOG2 6
|
---|
126 | #define PR_BITS_PER_FLOAT_LOG2 5
|
---|
127 | #define PR_BITS_PER_DOUBLE_LOG2 6
|
---|
128 | #define PR_BITS_PER_WORD_LOG2 6
|
---|
129 |
|
---|
130 | #define PR_ALIGN_OF_SHORT 2
|
---|
131 | #define PR_ALIGN_OF_INT 4
|
---|
132 | #define PR_ALIGN_OF_LONG 8
|
---|
133 | #define PR_ALIGN_OF_INT64 8
|
---|
134 | #define PR_ALIGN_OF_FLOAT 4
|
---|
135 | #define PR_ALIGN_OF_DOUBLE 8
|
---|
136 | #define PR_ALIGN_OF_POINTER 8
|
---|
137 | #define PR_ALIGN_OF_WORD 8
|
---|
138 |
|
---|
139 | #define PR_BYTES_PER_WORD_LOG2 3
|
---|
140 | #define PR_BYTES_PER_DWORD_LOG2 3
|
---|
141 |
|
---|
142 | #elif defined(__ia64__)
|
---|
143 |
|
---|
144 | #define IS_LITTLE_ENDIAN 1
|
---|
145 | #undef IS_BIG_ENDIAN
|
---|
146 | #define IS_64
|
---|
147 |
|
---|
148 | #define PR_BYTES_PER_BYTE 1
|
---|
149 | #define PR_BYTES_PER_SHORT 2
|
---|
150 | #define PR_BYTES_PER_INT 4
|
---|
151 | #define PR_BYTES_PER_INT64 8
|
---|
152 | #define PR_BYTES_PER_LONG 8
|
---|
153 | #define PR_BYTES_PER_FLOAT 4
|
---|
154 | #define PR_BYTES_PER_DOUBLE 8
|
---|
155 | #define PR_BYTES_PER_WORD 8
|
---|
156 | #define PR_BYTES_PER_DWORD 8
|
---|
157 |
|
---|
158 | #define PR_BITS_PER_BYTE 8
|
---|
159 | #define PR_BITS_PER_SHORT 16
|
---|
160 | #define PR_BITS_PER_INT 32
|
---|
161 | #define PR_BITS_PER_INT64 64
|
---|
162 | #define PR_BITS_PER_LONG 64
|
---|
163 | #define PR_BITS_PER_FLOAT 32
|
---|
164 | #define PR_BITS_PER_DOUBLE 64
|
---|
165 | #define PR_BITS_PER_WORD 64
|
---|
166 |
|
---|
167 | #define PR_BITS_PER_BYTE_LOG2 3
|
---|
168 | #define PR_BITS_PER_SHORT_LOG2 4
|
---|
169 | #define PR_BITS_PER_INT_LOG2 5
|
---|
170 | #define PR_BITS_PER_INT64_LOG2 6
|
---|
171 | #define PR_BITS_PER_LONG_LOG2 6
|
---|
172 | #define PR_BITS_PER_FLOAT_LOG2 5
|
---|
173 | #define PR_BITS_PER_DOUBLE_LOG2 6
|
---|
174 | #define PR_BITS_PER_WORD_LOG2 6
|
---|
175 |
|
---|
176 | #define PR_ALIGN_OF_SHORT 2
|
---|
177 | #define PR_ALIGN_OF_INT 4
|
---|
178 | #define PR_ALIGN_OF_LONG 8
|
---|
179 | #define PR_ALIGN_OF_INT64 8
|
---|
180 | #define PR_ALIGN_OF_FLOAT 4
|
---|
181 | #define PR_ALIGN_OF_DOUBLE 8
|
---|
182 | #define PR_ALIGN_OF_POINTER 8
|
---|
183 | #define PR_ALIGN_OF_WORD 8
|
---|
184 |
|
---|
185 | #define PR_BYTES_PER_WORD_LOG2 3
|
---|
186 | #define PR_BYTES_PER_DWORD_LOG2 3
|
---|
187 |
|
---|
188 | #elif defined(__x86_64__)
|
---|
189 |
|
---|
190 | #define IS_LITTLE_ENDIAN 1
|
---|
191 | #undef IS_BIG_ENDIAN
|
---|
192 | #define IS_64
|
---|
193 |
|
---|
194 | #define PR_BYTES_PER_BYTE 1
|
---|
195 | #define PR_BYTES_PER_SHORT 2
|
---|
196 | #define PR_BYTES_PER_INT 4
|
---|
197 | #define PR_BYTES_PER_INT64 8
|
---|
198 | #define PR_BYTES_PER_LONG 8
|
---|
199 | #define PR_BYTES_PER_FLOAT 4
|
---|
200 | #define PR_BYTES_PER_DOUBLE 8
|
---|
201 | #define PR_BYTES_PER_WORD 8
|
---|
202 | #define PR_BYTES_PER_DWORD 8
|
---|
203 |
|
---|
204 | #define PR_BITS_PER_BYTE 8
|
---|
205 | #define PR_BITS_PER_SHORT 16
|
---|
206 | #define PR_BITS_PER_INT 32
|
---|
207 | #define PR_BITS_PER_INT64 64
|
---|
208 | #define PR_BITS_PER_LONG 64
|
---|
209 | #define PR_BITS_PER_FLOAT 32
|
---|
210 | #define PR_BITS_PER_DOUBLE 64
|
---|
211 | #define PR_BITS_PER_WORD 64
|
---|
212 |
|
---|
213 | #define PR_BITS_PER_BYTE_LOG2 3
|
---|
214 | #define PR_BITS_PER_SHORT_LOG2 4
|
---|
215 | #define PR_BITS_PER_INT_LOG2 5
|
---|
216 | #define PR_BITS_PER_INT64_LOG2 6
|
---|
217 | #define PR_BITS_PER_LONG_LOG2 6
|
---|
218 | #define PR_BITS_PER_FLOAT_LOG2 5
|
---|
219 | #define PR_BITS_PER_DOUBLE_LOG2 6
|
---|
220 | #define PR_BITS_PER_WORD_LOG2 6
|
---|
221 |
|
---|
222 | #define PR_ALIGN_OF_SHORT 2
|
---|
223 | #define PR_ALIGN_OF_INT 4
|
---|
224 | #define PR_ALIGN_OF_LONG 8
|
---|
225 | #define PR_ALIGN_OF_INT64 8
|
---|
226 | #define PR_ALIGN_OF_FLOAT 4
|
---|
227 | #define PR_ALIGN_OF_DOUBLE 8
|
---|
228 | #define PR_ALIGN_OF_POINTER 8
|
---|
229 | #define PR_ALIGN_OF_WORD 8
|
---|
230 |
|
---|
231 | #define PR_BYTES_PER_WORD_LOG2 3
|
---|
232 | #define PR_BYTES_PER_DWORD_LOG2 3
|
---|
233 |
|
---|
234 | #elif defined(__mc68000__)
|
---|
235 |
|
---|
236 | #undef IS_LITTLE_ENDIAN
|
---|
237 | #define IS_BIG_ENDIAN 1
|
---|
238 |
|
---|
239 | #define PR_BYTES_PER_BYTE 1
|
---|
240 | #define PR_BYTES_PER_SHORT 2
|
---|
241 | #define PR_BYTES_PER_INT 4
|
---|
242 | #define PR_BYTES_PER_INT64 8
|
---|
243 | #define PR_BYTES_PER_LONG 4
|
---|
244 | #define PR_BYTES_PER_FLOAT 4
|
---|
245 | #define PR_BYTES_PER_DOUBLE 8
|
---|
246 | #define PR_BYTES_PER_WORD 4
|
---|
247 | #define PR_BYTES_PER_DWORD 8
|
---|
248 |
|
---|
249 | #define PR_BITS_PER_BYTE 8
|
---|
250 | #define PR_BITS_PER_SHORT 16
|
---|
251 | #define PR_BITS_PER_INT 32
|
---|
252 | #define PR_BITS_PER_INT64 64
|
---|
253 | #define PR_BITS_PER_LONG 32
|
---|
254 | #define PR_BITS_PER_FLOAT 32
|
---|
255 | #define PR_BITS_PER_DOUBLE 64
|
---|
256 | #define PR_BITS_PER_WORD 32
|
---|
257 |
|
---|
258 | #define PR_BITS_PER_BYTE_LOG2 3
|
---|
259 | #define PR_BITS_PER_SHORT_LOG2 4
|
---|
260 | #define PR_BITS_PER_INT_LOG2 5
|
---|
261 | #define PR_BITS_PER_INT64_LOG2 6
|
---|
262 | #define PR_BITS_PER_LONG_LOG2 5
|
---|
263 | #define PR_BITS_PER_FLOAT_LOG2 5
|
---|
264 | #define PR_BITS_PER_DOUBLE_LOG2 6
|
---|
265 | #define PR_BITS_PER_WORD_LOG2 5
|
---|
266 |
|
---|
267 | #define PR_ALIGN_OF_SHORT 2
|
---|
268 | #define PR_ALIGN_OF_INT 2
|
---|
269 | #define PR_ALIGN_OF_LONG 2
|
---|
270 | #define PR_ALIGN_OF_INT64 2
|
---|
271 | #define PR_ALIGN_OF_FLOAT 2
|
---|
272 | #define PR_ALIGN_OF_DOUBLE 2
|
---|
273 | #define PR_ALIGN_OF_POINTER 2
|
---|
274 | #define PR_ALIGN_OF_WORD 2
|
---|
275 |
|
---|
276 | #define PR_BYTES_PER_WORD_LOG2 2
|
---|
277 | #define PR_BYTES_PER_DWORD_LOG2 3
|
---|
278 |
|
---|
279 | #elif defined(__sparc__)
|
---|
280 |
|
---|
281 | #undef IS_LITTLE_ENDIAN
|
---|
282 | #define IS_BIG_ENDIAN 1
|
---|
283 |
|
---|
284 | #define PR_BYTES_PER_BYTE 1
|
---|
285 | #define PR_BYTES_PER_SHORT 2
|
---|
286 | #define PR_BYTES_PER_INT 4
|
---|
287 | #define PR_BYTES_PER_INT64 8
|
---|
288 | #define PR_BYTES_PER_LONG 4
|
---|
289 | #define PR_BYTES_PER_FLOAT 4
|
---|
290 | #define PR_BYTES_PER_DOUBLE 8
|
---|
291 | #define PR_BYTES_PER_WORD 4
|
---|
292 | #define PR_BYTES_PER_DWORD 8
|
---|
293 |
|
---|
294 | #define PR_BITS_PER_BYTE 8
|
---|
295 | #define PR_BITS_PER_SHORT 16
|
---|
296 | #define PR_BITS_PER_INT 32
|
---|
297 | #define PR_BITS_PER_INT64 64
|
---|
298 | #define PR_BITS_PER_LONG 32
|
---|
299 | #define PR_BITS_PER_FLOAT 32
|
---|
300 | #define PR_BITS_PER_DOUBLE 64
|
---|
301 | #define PR_BITS_PER_WORD 32
|
---|
302 |
|
---|
303 | #define PR_BITS_PER_BYTE_LOG2 3
|
---|
304 | #define PR_BITS_PER_SHORT_LOG2 4
|
---|
305 | #define PR_BITS_PER_INT_LOG2 5
|
---|
306 | #define PR_BITS_PER_INT64_LOG2 6
|
---|
307 | #define PR_BITS_PER_LONG_LOG2 5
|
---|
308 | #define PR_BITS_PER_FLOAT_LOG2 5
|
---|
309 | #define PR_BITS_PER_DOUBLE_LOG2 6
|
---|
310 | #define PR_BITS_PER_WORD_LOG2 5
|
---|
311 |
|
---|
312 | #define PR_ALIGN_OF_SHORT 2
|
---|
313 | #define PR_ALIGN_OF_INT 4
|
---|
314 | #define PR_ALIGN_OF_LONG 4
|
---|
315 | #define PR_ALIGN_OF_INT64 8
|
---|
316 | #define PR_ALIGN_OF_FLOAT 4
|
---|
317 | #define PR_ALIGN_OF_DOUBLE 8
|
---|
318 | #define PR_ALIGN_OF_POINTER 4
|
---|
319 | #define PR_ALIGN_OF_WORD 4
|
---|
320 |
|
---|
321 | #define PR_BYTES_PER_WORD_LOG2 2
|
---|
322 | #define PR_BYTES_PER_DWORD_LOG2 3
|
---|
323 |
|
---|
324 | #elif defined(__i386__)
|
---|
325 |
|
---|
326 | #define IS_LITTLE_ENDIAN 1
|
---|
327 | #undef IS_BIG_ENDIAN
|
---|
328 |
|
---|
329 | #define PR_BYTES_PER_BYTE 1
|
---|
330 | #define PR_BYTES_PER_SHORT 2
|
---|
331 | #define PR_BYTES_PER_INT 4
|
---|
332 | #define PR_BYTES_PER_INT64 8
|
---|
333 | #define PR_BYTES_PER_LONG 4
|
---|
334 | #define PR_BYTES_PER_FLOAT 4
|
---|
335 | #define PR_BYTES_PER_DOUBLE 8
|
---|
336 | #define PR_BYTES_PER_WORD 4
|
---|
337 | #define PR_BYTES_PER_DWORD 8
|
---|
338 |
|
---|
339 | #define PR_BITS_PER_BYTE 8
|
---|
340 | #define PR_BITS_PER_SHORT 16
|
---|
341 | #define PR_BITS_PER_INT 32
|
---|
342 | #define PR_BITS_PER_INT64 64
|
---|
343 | #define PR_BITS_PER_LONG 32
|
---|
344 | #define PR_BITS_PER_FLOAT 32
|
---|
345 | #define PR_BITS_PER_DOUBLE 64
|
---|
346 | #define PR_BITS_PER_WORD 32
|
---|
347 |
|
---|
348 | #define PR_BITS_PER_BYTE_LOG2 3
|
---|
349 | #define PR_BITS_PER_SHORT_LOG2 4
|
---|
350 | #define PR_BITS_PER_INT_LOG2 5
|
---|
351 | #define PR_BITS_PER_INT64_LOG2 6
|
---|
352 | #define PR_BITS_PER_LONG_LOG2 5
|
---|
353 | #define PR_BITS_PER_FLOAT_LOG2 5
|
---|
354 | #define PR_BITS_PER_DOUBLE_LOG2 6
|
---|
355 | #define PR_BITS_PER_WORD_LOG2 5
|
---|
356 |
|
---|
357 | #define PR_ALIGN_OF_SHORT 2
|
---|
358 | #define PR_ALIGN_OF_INT 4
|
---|
359 | #define PR_ALIGN_OF_LONG 4
|
---|
360 | #define PR_ALIGN_OF_INT64 4
|
---|
361 | #define PR_ALIGN_OF_FLOAT 4
|
---|
362 | #define PR_ALIGN_OF_DOUBLE 4
|
---|
363 | #define PR_ALIGN_OF_POINTER 4
|
---|
364 | #define PR_ALIGN_OF_WORD 4
|
---|
365 |
|
---|
366 | #define PR_BYTES_PER_WORD_LOG2 2
|
---|
367 | #define PR_BYTES_PER_DWORD_LOG2 3
|
---|
368 |
|
---|
369 | #elif defined(__mips__)
|
---|
370 |
|
---|
371 | #ifdef __MIPSEB__
|
---|
372 | #define IS_BIG_ENDIAN 1
|
---|
373 | #undef IS_LITTLE_ENDIAN
|
---|
374 | #elif defined(__MIPSEL__)
|
---|
375 | #define IS_LITTLE_ENDIAN 1
|
---|
376 | #undef IS_BIG_ENDIAN
|
---|
377 | #else
|
---|
378 | #error "Unknown MIPS endianness."
|
---|
379 | #endif
|
---|
380 |
|
---|
381 | #define PR_BYTES_PER_BYTE 1
|
---|
382 | #define PR_BYTES_PER_SHORT 2
|
---|
383 | #define PR_BYTES_PER_INT 4
|
---|
384 | #define PR_BYTES_PER_INT64 8
|
---|
385 | #define PR_BYTES_PER_LONG 4
|
---|
386 | #define PR_BYTES_PER_FLOAT 4
|
---|
387 | #define PR_BYTES_PER_DOUBLE 8
|
---|
388 | #define PR_BYTES_PER_WORD 4
|
---|
389 | #define PR_BYTES_PER_DWORD 8
|
---|
390 |
|
---|
391 | #define PR_BITS_PER_BYTE 8
|
---|
392 | #define PR_BITS_PER_SHORT 16
|
---|
393 | #define PR_BITS_PER_INT 32
|
---|
394 | #define PR_BITS_PER_INT64 64
|
---|
395 | #define PR_BITS_PER_LONG 32
|
---|
396 | #define PR_BITS_PER_FLOAT 32
|
---|
397 | #define PR_BITS_PER_DOUBLE 64
|
---|
398 | #define PR_BITS_PER_WORD 32
|
---|
399 |
|
---|
400 | #define PR_BITS_PER_BYTE_LOG2 3
|
---|
401 | #define PR_BITS_PER_SHORT_LOG2 4
|
---|
402 | #define PR_BITS_PER_INT_LOG2 5
|
---|
403 | #define PR_BITS_PER_INT64_LOG2 6
|
---|
404 | #define PR_BITS_PER_LONG_LOG2 5
|
---|
405 | #define PR_BITS_PER_FLOAT_LOG2 5
|
---|
406 | #define PR_BITS_PER_DOUBLE_LOG2 6
|
---|
407 | #define PR_BITS_PER_WORD_LOG2 5
|
---|
408 |
|
---|
409 | #define PR_ALIGN_OF_SHORT 2
|
---|
410 | #define PR_ALIGN_OF_INT 4
|
---|
411 | #define PR_ALIGN_OF_LONG 4
|
---|
412 | #define PR_ALIGN_OF_INT64 8
|
---|
413 | #define PR_ALIGN_OF_FLOAT 4
|
---|
414 | #define PR_ALIGN_OF_DOUBLE 8
|
---|
415 | #define PR_ALIGN_OF_POINTER 4
|
---|
416 | #define PR_ALIGN_OF_WORD 4
|
---|
417 |
|
---|
418 | #define PR_BYTES_PER_WORD_LOG2 2
|
---|
419 | #define PR_BYTES_PER_DWORD_LOG2 3
|
---|
420 |
|
---|
421 | #elif defined(__arm__)
|
---|
422 |
|
---|
423 | #define IS_LITTLE_ENDIAN 1
|
---|
424 | #undef IS_BIG_ENDIAN
|
---|
425 |
|
---|
426 | #define PR_BYTES_PER_BYTE 1
|
---|
427 | #define PR_BYTES_PER_SHORT 2
|
---|
428 | #define PR_BYTES_PER_INT 4
|
---|
429 | #define PR_BYTES_PER_INT64 8
|
---|
430 | #define PR_BYTES_PER_LONG 4
|
---|
431 | #define PR_BYTES_PER_FLOAT 4
|
---|
432 | #define PR_BYTES_PER_DOUBLE 8
|
---|
433 | #define PR_BYTES_PER_WORD 4
|
---|
434 | #define PR_BYTES_PER_DWORD 8
|
---|
435 |
|
---|
436 | #define PR_BITS_PER_BYTE 8
|
---|
437 | #define PR_BITS_PER_SHORT 16
|
---|
438 | #define PR_BITS_PER_INT 32
|
---|
439 | #define PR_BITS_PER_INT64 64
|
---|
440 | #define PR_BITS_PER_LONG 32
|
---|
441 | #define PR_BITS_PER_FLOAT 32
|
---|
442 | #define PR_BITS_PER_DOUBLE 64
|
---|
443 | #define PR_BITS_PER_WORD 32
|
---|
444 |
|
---|
445 | #define PR_BITS_PER_BYTE_LOG2 3
|
---|
446 | #define PR_BITS_PER_SHORT_LOG2 4
|
---|
447 | #define PR_BITS_PER_INT_LOG2 5
|
---|
448 | #define PR_BITS_PER_INT64_LOG2 6
|
---|
449 | #define PR_BITS_PER_LONG_LOG2 5
|
---|
450 | #define PR_BITS_PER_FLOAT_LOG2 5
|
---|
451 | #define PR_BITS_PER_DOUBLE_LOG2 6
|
---|
452 | #define PR_BITS_PER_WORD_LOG2 5
|
---|
453 |
|
---|
454 | #define PR_ALIGN_OF_SHORT 2
|
---|
455 | #define PR_ALIGN_OF_INT 4
|
---|
456 | #define PR_ALIGN_OF_LONG 4
|
---|
457 | #define PR_ALIGN_OF_INT64 4
|
---|
458 | #define PR_ALIGN_OF_FLOAT 4
|
---|
459 | #define PR_ALIGN_OF_DOUBLE 4
|
---|
460 | #define PR_ALIGN_OF_POINTER 4
|
---|
461 | #define PR_ALIGN_OF_WORD 4
|
---|
462 |
|
---|
463 | #define PR_BYTES_PER_WORD_LOG2 2
|
---|
464 | #define PR_BYTES_PER_DWORD_LOG2 3
|
---|
465 |
|
---|
466 | #elif defined(__hppa__)
|
---|
467 |
|
---|
468 | #undef IS_LITTLE_ENDIAN
|
---|
469 | #define IS_BIG_ENDIAN 1
|
---|
470 |
|
---|
471 | #define PR_BYTES_PER_BYTE 1
|
---|
472 | #define PR_BYTES_PER_SHORT 2
|
---|
473 | #define PR_BYTES_PER_INT 4
|
---|
474 | #define PR_BYTES_PER_INT64 8
|
---|
475 | #define PR_BYTES_PER_LONG 4
|
---|
476 | #define PR_BYTES_PER_FLOAT 4
|
---|
477 | #define PR_BYTES_PER_DOUBLE 8
|
---|
478 | #define PR_BYTES_PER_WORD 4
|
---|
479 | #define PR_BYTES_PER_DWORD 8
|
---|
480 |
|
---|
481 | #define PR_BITS_PER_BYTE 8
|
---|
482 | #define PR_BITS_PER_SHORT 16
|
---|
483 | #define PR_BITS_PER_INT 32
|
---|
484 | #define PR_BITS_PER_INT64 64
|
---|
485 | #define PR_BITS_PER_LONG 32
|
---|
486 | #define PR_BITS_PER_FLOAT 32
|
---|
487 | #define PR_BITS_PER_DOUBLE 64
|
---|
488 | #define PR_BITS_PER_WORD 32
|
---|
489 |
|
---|
490 | #define PR_BITS_PER_BYTE_LOG2 3
|
---|
491 | #define PR_BITS_PER_SHORT_LOG2 4
|
---|
492 | #define PR_BITS_PER_INT_LOG2 5
|
---|
493 | #define PR_BITS_PER_INT64_LOG2 6
|
---|
494 | #define PR_BITS_PER_LONG_LOG2 5
|
---|
495 | #define PR_BITS_PER_FLOAT_LOG2 5
|
---|
496 | #define PR_BITS_PER_DOUBLE_LOG2 6
|
---|
497 | #define PR_BITS_PER_WORD_LOG2 5
|
---|
498 |
|
---|
499 | #define PR_ALIGN_OF_SHORT 2
|
---|
500 | #define PR_ALIGN_OF_INT 4
|
---|
501 | #define PR_ALIGN_OF_LONG 4
|
---|
502 | #define PR_ALIGN_OF_INT64 8
|
---|
503 | #define PR_ALIGN_OF_FLOAT 4
|
---|
504 | #define PR_ALIGN_OF_DOUBLE 8
|
---|
505 | #define PR_ALIGN_OF_POINTER 4
|
---|
506 | #define PR_ALIGN_OF_WORD 4
|
---|
507 |
|
---|
508 | #define PR_BYTES_PER_WORD_LOG2 2
|
---|
509 | #define PR_BYTES_PER_DWORD_LOG2 3
|
---|
510 |
|
---|
511 | #elif defined(__s390__)
|
---|
512 |
|
---|
513 | #define IS_BIG_ENDIAN 1
|
---|
514 | #undef IS_LITTLE_ENDIAN
|
---|
515 |
|
---|
516 | #define PR_BYTES_PER_BYTE 1
|
---|
517 | #define PR_BYTES_PER_SHORT 2
|
---|
518 | #define PR_BYTES_PER_INT 4
|
---|
519 | #define PR_BYTES_PER_INT64 8
|
---|
520 | #define PR_BYTES_PER_LONG 4
|
---|
521 | #define PR_BYTES_PER_FLOAT 4
|
---|
522 | #define PR_BYTES_PER_DOUBLE 8
|
---|
523 | #define PR_BYTES_PER_WORD 4
|
---|
524 | #define PR_BYTES_PER_DWORD 8
|
---|
525 |
|
---|
526 | #define PR_BITS_PER_BYTE 8
|
---|
527 | #define PR_BITS_PER_SHORT 16
|
---|
528 | #define PR_BITS_PER_INT 32
|
---|
529 | #define PR_BITS_PER_INT64 64
|
---|
530 | #define PR_BITS_PER_LONG 32
|
---|
531 | #define PR_BITS_PER_FLOAT 32
|
---|
532 | #define PR_BITS_PER_DOUBLE 64
|
---|
533 | #define PR_BITS_PER_WORD 32
|
---|
534 |
|
---|
535 | #define PR_BITS_PER_BYTE_LOG2 3
|
---|
536 | #define PR_BITS_PER_SHORT_LOG2 4
|
---|
537 | #define PR_BITS_PER_INT_LOG2 5
|
---|
538 | #define PR_BITS_PER_INT64_LOG2 6
|
---|
539 | #define PR_BITS_PER_LONG_LOG2 5
|
---|
540 | #define PR_BITS_PER_FLOAT_LOG2 5
|
---|
541 | #define PR_BITS_PER_DOUBLE_LOG2 6
|
---|
542 | #define PR_BITS_PER_WORD_LOG2 5
|
---|
543 |
|
---|
544 | #define PR_ALIGN_OF_SHORT 2
|
---|
545 | #define PR_ALIGN_OF_INT 4
|
---|
546 | #define PR_ALIGN_OF_LONG 4
|
---|
547 | #define PR_ALIGN_OF_INT64 4
|
---|
548 | #define PR_ALIGN_OF_FLOAT 4
|
---|
549 | #define PR_ALIGN_OF_DOUBLE 4
|
---|
550 | #define PR_ALIGN_OF_POINTER 4
|
---|
551 | #define PR_ALIGN_OF_WORD 4
|
---|
552 |
|
---|
553 | #define PR_BYTES_PER_WORD_LOG2 2
|
---|
554 | #define PR_BYTES_PER_DWORD_LOG2 3
|
---|
555 |
|
---|
556 | #elif defined(__s390x__)
|
---|
557 |
|
---|
558 | #define IS_BIG_ENDIAN 1
|
---|
559 | #undef IS_LITTLE_ENDIAN
|
---|
560 | #define IS_64
|
---|
561 |
|
---|
562 | #define PR_BYTES_PER_BYTE 1
|
---|
563 | #define PR_BYTES_PER_SHORT 2
|
---|
564 | #define PR_BYTES_PER_INT 4
|
---|
565 | #define PR_BYTES_PER_INT64 8
|
---|
566 | #define PR_BYTES_PER_LONG 8
|
---|
567 | #define PR_BYTES_PER_FLOAT 4
|
---|
568 | #define PR_BYTES_PER_DOUBLE 8
|
---|
569 | #define PR_BYTES_PER_WORD 8
|
---|
570 | #define PR_BYTES_PER_DWORD 8
|
---|
571 |
|
---|
572 | #define PR_BITS_PER_BYTE 8
|
---|
573 | #define PR_BITS_PER_SHORT 16
|
---|
574 | #define PR_BITS_PER_INT 32
|
---|
575 | #define PR_BITS_PER_INT64 64
|
---|
576 | #define PR_BITS_PER_LONG 64
|
---|
577 | #define PR_BITS_PER_FLOAT 32
|
---|
578 | #define PR_BITS_PER_DOUBLE 64
|
---|
579 | #define PR_BITS_PER_WORD 64
|
---|
580 |
|
---|
581 | #define PR_BITS_PER_BYTE_LOG2 3
|
---|
582 | #define PR_BITS_PER_SHORT_LOG2 4
|
---|
583 | #define PR_BITS_PER_INT_LOG2 5
|
---|
584 | #define PR_BITS_PER_INT64_LOG2 6
|
---|
585 | #define PR_BITS_PER_LONG_LOG2 6
|
---|
586 | #define PR_BITS_PER_FLOAT_LOG2 5
|
---|
587 | #define PR_BITS_PER_DOUBLE_LOG2 6
|
---|
588 | #define PR_BITS_PER_WORD_LOG2 6
|
---|
589 |
|
---|
590 | #define PR_ALIGN_OF_SHORT 2
|
---|
591 | #define PR_ALIGN_OF_INT 4
|
---|
592 | #define PR_ALIGN_OF_LONG 8
|
---|
593 | #define PR_ALIGN_OF_INT64 8
|
---|
594 | #define PR_ALIGN_OF_FLOAT 4
|
---|
595 | #define PR_ALIGN_OF_DOUBLE 8
|
---|
596 | #define PR_ALIGN_OF_POINTER 8
|
---|
597 | #define PR_ALIGN_OF_WORD 8
|
---|
598 |
|
---|
599 | #define PR_BYTES_PER_WORD_LOG2 3
|
---|
600 | #define PR_BYTES_PER_DWORD_LOG2 3
|
---|
601 |
|
---|
602 | #else
|
---|
603 |
|
---|
604 | #error "Unknown CPU architecture"
|
---|
605 |
|
---|
606 | #endif
|
---|
607 |
|
---|
608 | #define HAVE_LONG_LONG
|
---|
609 | #if PR_ALIGN_OF_DOUBLE == 8
|
---|
610 | #define HAVE_ALIGNED_DOUBLES
|
---|
611 | #endif
|
---|
612 | #if PR_ALIGN_OF_INT64 == 8
|
---|
613 | #define HAVE_ALIGNED_LONGLONGS
|
---|
614 | #endif
|
---|
615 |
|
---|
616 | #ifndef NO_NSPR_10_SUPPORT
|
---|
617 |
|
---|
618 | #define BYTES_PER_BYTE PR_BYTES_PER_BYTE
|
---|
619 | #define BYTES_PER_SHORT PR_BYTES_PER_SHORT
|
---|
620 | #define BYTES_PER_INT PR_BYTES_PER_INT
|
---|
621 | #define BYTES_PER_INT64 PR_BYTES_PER_INT64
|
---|
622 | #define BYTES_PER_LONG PR_BYTES_PER_LONG
|
---|
623 | #define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
|
---|
624 | #define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
|
---|
625 | #define BYTES_PER_WORD PR_BYTES_PER_WORD
|
---|
626 | #define BYTES_PER_DWORD PR_BYTES_PER_DWORD
|
---|
627 |
|
---|
628 | #define BITS_PER_BYTE PR_BITS_PER_BYTE
|
---|
629 | #define BITS_PER_SHORT PR_BITS_PER_SHORT
|
---|
630 | #define BITS_PER_INT PR_BITS_PER_INT
|
---|
631 | #define BITS_PER_INT64 PR_BITS_PER_INT64
|
---|
632 | #define BITS_PER_LONG PR_BITS_PER_LONG
|
---|
633 | #define BITS_PER_FLOAT PR_BITS_PER_FLOAT
|
---|
634 | #define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
|
---|
635 | #define BITS_PER_WORD PR_BITS_PER_WORD
|
---|
636 |
|
---|
637 | #define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
|
---|
638 | #define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
|
---|
639 | #define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
|
---|
640 | #define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
|
---|
641 | #define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
|
---|
642 | #define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
|
---|
643 | #define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
|
---|
644 | #define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
|
---|
645 |
|
---|
646 | #define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
|
---|
647 | #define ALIGN_OF_INT PR_ALIGN_OF_INT
|
---|
648 | #define ALIGN_OF_LONG PR_ALIGN_OF_LONG
|
---|
649 | #define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
|
---|
650 | #define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
|
---|
651 | #define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
|
---|
652 | #define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
|
---|
653 | #define ALIGN_OF_WORD PR_ALIGN_OF_WORD
|
---|
654 |
|
---|
655 | #define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
|
---|
656 | #define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
|
---|
657 | #define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
|
---|
658 |
|
---|
659 | #endif /* NO_NSPR_10_SUPPORT */
|
---|
660 |
|
---|
661 | #endif /* nspr_cpucfg___ */
|
---|