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 /* |
|
39 * This file is used by not only Linux but also other glibc systems |
|
40 * such as GNU/Hurd and GNU/k*BSD. |
|
41 */ |
|
42 |
|
43 #ifndef nspr_cpucfg___ |
|
44 #define nspr_cpucfg___ |
|
45 |
|
46 #ifndef XP_UNIX |
|
47 #define XP_UNIX |
|
48 #endif |
|
49 |
|
50 #if !defined(LINUX) && defined(__linux__) |
|
51 #define LINUX |
|
52 #endif |
|
53 |
|
54 #ifdef __FreeBSD_kernel__ |
|
55 #define PR_AF_INET6 28 /* same as AF_INET6 */ |
|
56 #else |
|
57 #define PR_AF_INET6 10 /* same as AF_INET6 */ |
|
58 #endif |
|
59 |
|
60 #ifdef __powerpc64__ |
|
61 |
|
62 #undef IS_LITTLE_ENDIAN |
|
63 #define IS_BIG_ENDIAN 1 |
|
64 #define IS_64 |
|
65 |
|
66 #define PR_BYTES_PER_BYTE 1 |
|
67 #define PR_BYTES_PER_SHORT 2 |
|
68 #define PR_BYTES_PER_INT 4 |
|
69 #define PR_BYTES_PER_INT64 8 |
|
70 #define PR_BYTES_PER_LONG 8 |
|
71 #define PR_BYTES_PER_FLOAT 4 |
|
72 #define PR_BYTES_PER_DOUBLE 8 |
|
73 #define PR_BYTES_PER_WORD 8 |
|
74 #define PR_BYTES_PER_DWORD 8 |
|
75 |
|
76 #define PR_BITS_PER_BYTE 8 |
|
77 #define PR_BITS_PER_SHORT 16 |
|
78 #define PR_BITS_PER_INT 32 |
|
79 #define PR_BITS_PER_INT64 64 |
|
80 #define PR_BITS_PER_LONG 64 |
|
81 #define PR_BITS_PER_FLOAT 32 |
|
82 #define PR_BITS_PER_DOUBLE 64 |
|
83 #define PR_BITS_PER_WORD 64 |
|
84 |
|
85 #define PR_BITS_PER_BYTE_LOG2 3 |
|
86 #define PR_BITS_PER_SHORT_LOG2 4 |
|
87 #define PR_BITS_PER_INT_LOG2 5 |
|
88 #define PR_BITS_PER_INT64_LOG2 6 |
|
89 #define PR_BITS_PER_LONG_LOG2 6 |
|
90 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
91 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
92 #define PR_BITS_PER_WORD_LOG2 6 |
|
93 |
|
94 #define PR_ALIGN_OF_SHORT 2 |
|
95 #define PR_ALIGN_OF_INT 4 |
|
96 #define PR_ALIGN_OF_LONG 8 |
|
97 #define PR_ALIGN_OF_INT64 8 |
|
98 #define PR_ALIGN_OF_FLOAT 4 |
|
99 #define PR_ALIGN_OF_DOUBLE 8 |
|
100 #define PR_ALIGN_OF_POINTER 8 |
|
101 #define PR_ALIGN_OF_WORD 8 |
|
102 |
|
103 #define PR_BYTES_PER_WORD_LOG2 3 |
|
104 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
105 |
|
106 #elif defined(__powerpc__) |
|
107 |
|
108 #undef IS_LITTLE_ENDIAN |
|
109 #define IS_BIG_ENDIAN 1 |
|
110 |
|
111 #define PR_BYTES_PER_BYTE 1 |
|
112 #define PR_BYTES_PER_SHORT 2 |
|
113 #define PR_BYTES_PER_INT 4 |
|
114 #define PR_BYTES_PER_INT64 8 |
|
115 #define PR_BYTES_PER_LONG 4 |
|
116 #define PR_BYTES_PER_FLOAT 4 |
|
117 #define PR_BYTES_PER_DOUBLE 8 |
|
118 #define PR_BYTES_PER_WORD 4 |
|
119 #define PR_BYTES_PER_DWORD 8 |
|
120 |
|
121 #define PR_BITS_PER_BYTE 8 |
|
122 #define PR_BITS_PER_SHORT 16 |
|
123 #define PR_BITS_PER_INT 32 |
|
124 #define PR_BITS_PER_INT64 64 |
|
125 #define PR_BITS_PER_LONG 32 |
|
126 #define PR_BITS_PER_FLOAT 32 |
|
127 #define PR_BITS_PER_DOUBLE 64 |
|
128 #define PR_BITS_PER_WORD 32 |
|
129 |
|
130 #define PR_BITS_PER_BYTE_LOG2 3 |
|
131 #define PR_BITS_PER_SHORT_LOG2 4 |
|
132 #define PR_BITS_PER_INT_LOG2 5 |
|
133 #define PR_BITS_PER_INT64_LOG2 6 |
|
134 #define PR_BITS_PER_LONG_LOG2 5 |
|
135 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
136 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
137 #define PR_BITS_PER_WORD_LOG2 5 |
|
138 |
|
139 #define PR_ALIGN_OF_SHORT 2 |
|
140 #define PR_ALIGN_OF_INT 4 |
|
141 #define PR_ALIGN_OF_LONG 4 |
|
142 #define PR_ALIGN_OF_INT64 8 |
|
143 #define PR_ALIGN_OF_FLOAT 4 |
|
144 #define PR_ALIGN_OF_DOUBLE 8 |
|
145 #define PR_ALIGN_OF_POINTER 4 |
|
146 #define PR_ALIGN_OF_WORD 4 |
|
147 |
|
148 #define PR_BYTES_PER_WORD_LOG2 2 |
|
149 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
150 |
|
151 #elif defined(__alpha) |
|
152 |
|
153 #define IS_LITTLE_ENDIAN 1 |
|
154 #undef IS_BIG_ENDIAN |
|
155 #define IS_64 |
|
156 |
|
157 #define PR_BYTES_PER_BYTE 1 |
|
158 #define PR_BYTES_PER_SHORT 2 |
|
159 #define PR_BYTES_PER_INT 4 |
|
160 #define PR_BYTES_PER_INT64 8 |
|
161 #define PR_BYTES_PER_LONG 8 |
|
162 #define PR_BYTES_PER_FLOAT 4 |
|
163 #define PR_BYTES_PER_DOUBLE 8 |
|
164 #define PR_BYTES_PER_WORD 8 |
|
165 #define PR_BYTES_PER_DWORD 8 |
|
166 |
|
167 #define PR_BITS_PER_BYTE 8 |
|
168 #define PR_BITS_PER_SHORT 16 |
|
169 #define PR_BITS_PER_INT 32 |
|
170 #define PR_BITS_PER_INT64 64 |
|
171 #define PR_BITS_PER_LONG 64 |
|
172 #define PR_BITS_PER_FLOAT 32 |
|
173 #define PR_BITS_PER_DOUBLE 64 |
|
174 #define PR_BITS_PER_WORD 64 |
|
175 |
|
176 #define PR_BITS_PER_BYTE_LOG2 3 |
|
177 #define PR_BITS_PER_SHORT_LOG2 4 |
|
178 #define PR_BITS_PER_INT_LOG2 5 |
|
179 #define PR_BITS_PER_INT64_LOG2 6 |
|
180 #define PR_BITS_PER_LONG_LOG2 6 |
|
181 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
182 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
183 #define PR_BITS_PER_WORD_LOG2 6 |
|
184 |
|
185 #define PR_ALIGN_OF_SHORT 2 |
|
186 #define PR_ALIGN_OF_INT 4 |
|
187 #define PR_ALIGN_OF_LONG 8 |
|
188 #define PR_ALIGN_OF_INT64 8 |
|
189 #define PR_ALIGN_OF_FLOAT 4 |
|
190 #define PR_ALIGN_OF_DOUBLE 8 |
|
191 #define PR_ALIGN_OF_POINTER 8 |
|
192 #define PR_ALIGN_OF_WORD 8 |
|
193 |
|
194 #define PR_BYTES_PER_WORD_LOG2 3 |
|
195 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
196 |
|
197 #elif defined(__ia64__) |
|
198 |
|
199 #define IS_LITTLE_ENDIAN 1 |
|
200 #undef IS_BIG_ENDIAN |
|
201 #define IS_64 |
|
202 |
|
203 #define PR_BYTES_PER_BYTE 1 |
|
204 #define PR_BYTES_PER_SHORT 2 |
|
205 #define PR_BYTES_PER_INT 4 |
|
206 #define PR_BYTES_PER_INT64 8 |
|
207 #define PR_BYTES_PER_LONG 8 |
|
208 #define PR_BYTES_PER_FLOAT 4 |
|
209 #define PR_BYTES_PER_DOUBLE 8 |
|
210 #define PR_BYTES_PER_WORD 8 |
|
211 #define PR_BYTES_PER_DWORD 8 |
|
212 |
|
213 #define PR_BITS_PER_BYTE 8 |
|
214 #define PR_BITS_PER_SHORT 16 |
|
215 #define PR_BITS_PER_INT 32 |
|
216 #define PR_BITS_PER_INT64 64 |
|
217 #define PR_BITS_PER_LONG 64 |
|
218 #define PR_BITS_PER_FLOAT 32 |
|
219 #define PR_BITS_PER_DOUBLE 64 |
|
220 #define PR_BITS_PER_WORD 64 |
|
221 |
|
222 #define PR_BITS_PER_BYTE_LOG2 3 |
|
223 #define PR_BITS_PER_SHORT_LOG2 4 |
|
224 #define PR_BITS_PER_INT_LOG2 5 |
|
225 #define PR_BITS_PER_INT64_LOG2 6 |
|
226 #define PR_BITS_PER_LONG_LOG2 6 |
|
227 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
228 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
229 #define PR_BITS_PER_WORD_LOG2 6 |
|
230 |
|
231 #define PR_ALIGN_OF_SHORT 2 |
|
232 #define PR_ALIGN_OF_INT 4 |
|
233 #define PR_ALIGN_OF_LONG 8 |
|
234 #define PR_ALIGN_OF_INT64 8 |
|
235 #define PR_ALIGN_OF_FLOAT 4 |
|
236 #define PR_ALIGN_OF_DOUBLE 8 |
|
237 #define PR_ALIGN_OF_POINTER 8 |
|
238 #define PR_ALIGN_OF_WORD 8 |
|
239 |
|
240 #define PR_BYTES_PER_WORD_LOG2 3 |
|
241 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
242 |
|
243 #elif defined(__x86_64__) |
|
244 |
|
245 #define IS_LITTLE_ENDIAN 1 |
|
246 #undef IS_BIG_ENDIAN |
|
247 #define IS_64 |
|
248 |
|
249 #define PR_BYTES_PER_BYTE 1 |
|
250 #define PR_BYTES_PER_SHORT 2 |
|
251 #define PR_BYTES_PER_INT 4 |
|
252 #define PR_BYTES_PER_INT64 8 |
|
253 #define PR_BYTES_PER_LONG 8 |
|
254 #define PR_BYTES_PER_FLOAT 4 |
|
255 #define PR_BYTES_PER_DOUBLE 8 |
|
256 #define PR_BYTES_PER_WORD 8 |
|
257 #define PR_BYTES_PER_DWORD 8 |
|
258 |
|
259 #define PR_BITS_PER_BYTE 8 |
|
260 #define PR_BITS_PER_SHORT 16 |
|
261 #define PR_BITS_PER_INT 32 |
|
262 #define PR_BITS_PER_INT64 64 |
|
263 #define PR_BITS_PER_LONG 64 |
|
264 #define PR_BITS_PER_FLOAT 32 |
|
265 #define PR_BITS_PER_DOUBLE 64 |
|
266 #define PR_BITS_PER_WORD 64 |
|
267 |
|
268 #define PR_BITS_PER_BYTE_LOG2 3 |
|
269 #define PR_BITS_PER_SHORT_LOG2 4 |
|
270 #define PR_BITS_PER_INT_LOG2 5 |
|
271 #define PR_BITS_PER_INT64_LOG2 6 |
|
272 #define PR_BITS_PER_LONG_LOG2 6 |
|
273 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
274 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
275 #define PR_BITS_PER_WORD_LOG2 6 |
|
276 |
|
277 #define PR_ALIGN_OF_SHORT 2 |
|
278 #define PR_ALIGN_OF_INT 4 |
|
279 #define PR_ALIGN_OF_LONG 8 |
|
280 #define PR_ALIGN_OF_INT64 8 |
|
281 #define PR_ALIGN_OF_FLOAT 4 |
|
282 #define PR_ALIGN_OF_DOUBLE 8 |
|
283 #define PR_ALIGN_OF_POINTER 8 |
|
284 #define PR_ALIGN_OF_WORD 8 |
|
285 |
|
286 #define PR_BYTES_PER_WORD_LOG2 3 |
|
287 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
288 |
|
289 #elif defined(__mc68000__) |
|
290 |
|
291 #undef IS_LITTLE_ENDIAN |
|
292 #define IS_BIG_ENDIAN 1 |
|
293 |
|
294 #define PR_BYTES_PER_BYTE 1 |
|
295 #define PR_BYTES_PER_SHORT 2 |
|
296 #define PR_BYTES_PER_INT 4 |
|
297 #define PR_BYTES_PER_INT64 8 |
|
298 #define PR_BYTES_PER_LONG 4 |
|
299 #define PR_BYTES_PER_FLOAT 4 |
|
300 #define PR_BYTES_PER_DOUBLE 8 |
|
301 #define PR_BYTES_PER_WORD 4 |
|
302 #define PR_BYTES_PER_DWORD 8 |
|
303 |
|
304 #define PR_BITS_PER_BYTE 8 |
|
305 #define PR_BITS_PER_SHORT 16 |
|
306 #define PR_BITS_PER_INT 32 |
|
307 #define PR_BITS_PER_INT64 64 |
|
308 #define PR_BITS_PER_LONG 32 |
|
309 #define PR_BITS_PER_FLOAT 32 |
|
310 #define PR_BITS_PER_DOUBLE 64 |
|
311 #define PR_BITS_PER_WORD 32 |
|
312 |
|
313 #define PR_BITS_PER_BYTE_LOG2 3 |
|
314 #define PR_BITS_PER_SHORT_LOG2 4 |
|
315 #define PR_BITS_PER_INT_LOG2 5 |
|
316 #define PR_BITS_PER_INT64_LOG2 6 |
|
317 #define PR_BITS_PER_LONG_LOG2 5 |
|
318 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
319 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
320 #define PR_BITS_PER_WORD_LOG2 5 |
|
321 |
|
322 #define PR_ALIGN_OF_SHORT 2 |
|
323 #define PR_ALIGN_OF_INT 2 |
|
324 #define PR_ALIGN_OF_LONG 2 |
|
325 #define PR_ALIGN_OF_INT64 2 |
|
326 #define PR_ALIGN_OF_FLOAT 2 |
|
327 #define PR_ALIGN_OF_DOUBLE 2 |
|
328 #define PR_ALIGN_OF_POINTER 2 |
|
329 #define PR_ALIGN_OF_WORD 2 |
|
330 |
|
331 #define PR_BYTES_PER_WORD_LOG2 2 |
|
332 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
333 |
|
334 #elif defined(__sparc__) && defined (__arch64__) |
|
335 |
|
336 #undef IS_LITTLE_ENDIAN |
|
337 #define IS_BIG_ENDIAN 1 |
|
338 #define IS_64 |
|
339 |
|
340 #define PR_BYTES_PER_BYTE 1 |
|
341 #define PR_BYTES_PER_SHORT 2 |
|
342 #define PR_BYTES_PER_INT 4 |
|
343 #define PR_BYTES_PER_INT64 8 |
|
344 #define PR_BYTES_PER_LONG 8 |
|
345 #define PR_BYTES_PER_FLOAT 4 |
|
346 #define PR_BYTES_PER_DOUBLE 8 |
|
347 #define PR_BYTES_PER_WORD 8 |
|
348 #define PR_BYTES_PER_DWORD 8 |
|
349 |
|
350 #define PR_BITS_PER_BYTE 8 |
|
351 #define PR_BITS_PER_SHORT 16 |
|
352 #define PR_BITS_PER_INT 32 |
|
353 #define PR_BITS_PER_INT64 64 |
|
354 #define PR_BITS_PER_LONG 64 |
|
355 #define PR_BITS_PER_FLOAT 32 |
|
356 #define PR_BITS_PER_DOUBLE 64 |
|
357 #define PR_BITS_PER_WORD 64 |
|
358 |
|
359 #define PR_BITS_PER_BYTE_LOG2 3 |
|
360 #define PR_BITS_PER_SHORT_LOG2 4 |
|
361 #define PR_BITS_PER_INT_LOG2 5 |
|
362 #define PR_BITS_PER_INT64_LOG2 6 |
|
363 #define PR_BITS_PER_LONG_LOG2 6 |
|
364 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
365 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
366 #define PR_BITS_PER_WORD_LOG2 6 |
|
367 |
|
368 #define PR_ALIGN_OF_SHORT 2 |
|
369 #define PR_ALIGN_OF_INT 4 |
|
370 #define PR_ALIGN_OF_INT64 8 |
|
371 #define PR_ALIGN_OF_LONG 8 |
|
372 #define PR_ALIGN_OF_FLOAT 4 |
|
373 #define PR_ALIGN_OF_DOUBLE 8 |
|
374 #define PR_ALIGN_OF_POINTER 8 |
|
375 #define PR_ALIGN_OF_WORD 8 |
|
376 |
|
377 #define PR_BYTES_PER_WORD_LOG2 3 |
|
378 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
379 |
|
380 #elif defined(__sparc__) |
|
381 |
|
382 #undef IS_LITTLE_ENDIAN |
|
383 #define IS_BIG_ENDIAN 1 |
|
384 |
|
385 #define PR_BYTES_PER_BYTE 1 |
|
386 #define PR_BYTES_PER_SHORT 2 |
|
387 #define PR_BYTES_PER_INT 4 |
|
388 #define PR_BYTES_PER_INT64 8 |
|
389 #define PR_BYTES_PER_LONG 4 |
|
390 #define PR_BYTES_PER_FLOAT 4 |
|
391 #define PR_BYTES_PER_DOUBLE 8 |
|
392 #define PR_BYTES_PER_WORD 4 |
|
393 #define PR_BYTES_PER_DWORD 8 |
|
394 |
|
395 #define PR_BITS_PER_BYTE 8 |
|
396 #define PR_BITS_PER_SHORT 16 |
|
397 #define PR_BITS_PER_INT 32 |
|
398 #define PR_BITS_PER_INT64 64 |
|
399 #define PR_BITS_PER_LONG 32 |
|
400 #define PR_BITS_PER_FLOAT 32 |
|
401 #define PR_BITS_PER_DOUBLE 64 |
|
402 #define PR_BITS_PER_WORD 32 |
|
403 |
|
404 #define PR_BITS_PER_BYTE_LOG2 3 |
|
405 #define PR_BITS_PER_SHORT_LOG2 4 |
|
406 #define PR_BITS_PER_INT_LOG2 5 |
|
407 #define PR_BITS_PER_INT64_LOG2 6 |
|
408 #define PR_BITS_PER_LONG_LOG2 5 |
|
409 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
410 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
411 #define PR_BITS_PER_WORD_LOG2 5 |
|
412 |
|
413 #define PR_ALIGN_OF_SHORT 2 |
|
414 #define PR_ALIGN_OF_INT 4 |
|
415 #define PR_ALIGN_OF_LONG 4 |
|
416 #define PR_ALIGN_OF_INT64 8 |
|
417 #define PR_ALIGN_OF_FLOAT 4 |
|
418 #define PR_ALIGN_OF_DOUBLE 8 |
|
419 #define PR_ALIGN_OF_POINTER 4 |
|
420 #define PR_ALIGN_OF_WORD 4 |
|
421 |
|
422 #define PR_BYTES_PER_WORD_LOG2 2 |
|
423 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
424 |
|
425 #elif defined(__i386__) |
|
426 |
|
427 #define IS_LITTLE_ENDIAN 1 |
|
428 #undef IS_BIG_ENDIAN |
|
429 |
|
430 #define PR_BYTES_PER_BYTE 1 |
|
431 #define PR_BYTES_PER_SHORT 2 |
|
432 #define PR_BYTES_PER_INT 4 |
|
433 #define PR_BYTES_PER_INT64 8 |
|
434 #define PR_BYTES_PER_LONG 4 |
|
435 #define PR_BYTES_PER_FLOAT 4 |
|
436 #define PR_BYTES_PER_DOUBLE 8 |
|
437 #define PR_BYTES_PER_WORD 4 |
|
438 #define PR_BYTES_PER_DWORD 8 |
|
439 |
|
440 #define PR_BITS_PER_BYTE 8 |
|
441 #define PR_BITS_PER_SHORT 16 |
|
442 #define PR_BITS_PER_INT 32 |
|
443 #define PR_BITS_PER_INT64 64 |
|
444 #define PR_BITS_PER_LONG 32 |
|
445 #define PR_BITS_PER_FLOAT 32 |
|
446 #define PR_BITS_PER_DOUBLE 64 |
|
447 #define PR_BITS_PER_WORD 32 |
|
448 |
|
449 #define PR_BITS_PER_BYTE_LOG2 3 |
|
450 #define PR_BITS_PER_SHORT_LOG2 4 |
|
451 #define PR_BITS_PER_INT_LOG2 5 |
|
452 #define PR_BITS_PER_INT64_LOG2 6 |
|
453 #define PR_BITS_PER_LONG_LOG2 5 |
|
454 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
455 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
456 #define PR_BITS_PER_WORD_LOG2 5 |
|
457 |
|
458 #define PR_ALIGN_OF_SHORT 2 |
|
459 #define PR_ALIGN_OF_INT 4 |
|
460 #define PR_ALIGN_OF_LONG 4 |
|
461 #define PR_ALIGN_OF_INT64 4 |
|
462 #define PR_ALIGN_OF_FLOAT 4 |
|
463 #define PR_ALIGN_OF_DOUBLE 4 |
|
464 #define PR_ALIGN_OF_POINTER 4 |
|
465 #define PR_ALIGN_OF_WORD 4 |
|
466 |
|
467 #define PR_BYTES_PER_WORD_LOG2 2 |
|
468 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
469 |
|
470 #elif defined(__mips__) |
|
471 |
|
472 #ifdef __MIPSEB__ |
|
473 #define IS_BIG_ENDIAN 1 |
|
474 #undef IS_LITTLE_ENDIAN |
|
475 #elif defined(__MIPSEL__) |
|
476 #define IS_LITTLE_ENDIAN 1 |
|
477 #undef IS_BIG_ENDIAN |
|
478 #else |
|
479 #error "Unknown MIPS endianness." |
|
480 #endif |
|
481 |
|
482 #define PR_BYTES_PER_BYTE 1 |
|
483 #define PR_BYTES_PER_SHORT 2 |
|
484 #define PR_BYTES_PER_INT 4 |
|
485 #define PR_BYTES_PER_INT64 8 |
|
486 #define PR_BYTES_PER_LONG 4 |
|
487 #define PR_BYTES_PER_FLOAT 4 |
|
488 #define PR_BYTES_PER_DOUBLE 8 |
|
489 #define PR_BYTES_PER_WORD 4 |
|
490 #define PR_BYTES_PER_DWORD 8 |
|
491 |
|
492 #define PR_BITS_PER_BYTE 8 |
|
493 #define PR_BITS_PER_SHORT 16 |
|
494 #define PR_BITS_PER_INT 32 |
|
495 #define PR_BITS_PER_INT64 64 |
|
496 #define PR_BITS_PER_LONG 32 |
|
497 #define PR_BITS_PER_FLOAT 32 |
|
498 #define PR_BITS_PER_DOUBLE 64 |
|
499 #define PR_BITS_PER_WORD 32 |
|
500 |
|
501 #define PR_BITS_PER_BYTE_LOG2 3 |
|
502 #define PR_BITS_PER_SHORT_LOG2 4 |
|
503 #define PR_BITS_PER_INT_LOG2 5 |
|
504 #define PR_BITS_PER_INT64_LOG2 6 |
|
505 #define PR_BITS_PER_LONG_LOG2 5 |
|
506 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
507 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
508 #define PR_BITS_PER_WORD_LOG2 5 |
|
509 |
|
510 #define PR_ALIGN_OF_SHORT 2 |
|
511 #define PR_ALIGN_OF_INT 4 |
|
512 #define PR_ALIGN_OF_LONG 4 |
|
513 #define PR_ALIGN_OF_INT64 8 |
|
514 #define PR_ALIGN_OF_FLOAT 4 |
|
515 #define PR_ALIGN_OF_DOUBLE 8 |
|
516 #define PR_ALIGN_OF_POINTER 4 |
|
517 #define PR_ALIGN_OF_WORD 4 |
|
518 |
|
519 #define PR_BYTES_PER_WORD_LOG2 2 |
|
520 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
521 |
|
522 #elif defined(__arm__) |
|
523 |
|
524 #define IS_LITTLE_ENDIAN 1 |
|
525 #undef IS_BIG_ENDIAN |
|
526 |
|
527 #define PR_BYTES_PER_BYTE 1 |
|
528 #define PR_BYTES_PER_SHORT 2 |
|
529 #define PR_BYTES_PER_INT 4 |
|
530 #define PR_BYTES_PER_INT64 8 |
|
531 #define PR_BYTES_PER_LONG 4 |
|
532 #define PR_BYTES_PER_FLOAT 4 |
|
533 #define PR_BYTES_PER_DOUBLE 8 |
|
534 #define PR_BYTES_PER_WORD 4 |
|
535 #define PR_BYTES_PER_DWORD 8 |
|
536 |
|
537 #define PR_BITS_PER_BYTE 8 |
|
538 #define PR_BITS_PER_SHORT 16 |
|
539 #define PR_BITS_PER_INT 32 |
|
540 #define PR_BITS_PER_INT64 64 |
|
541 #define PR_BITS_PER_LONG 32 |
|
542 #define PR_BITS_PER_FLOAT 32 |
|
543 #define PR_BITS_PER_DOUBLE 64 |
|
544 #define PR_BITS_PER_WORD 32 |
|
545 |
|
546 #define PR_BITS_PER_BYTE_LOG2 3 |
|
547 #define PR_BITS_PER_SHORT_LOG2 4 |
|
548 #define PR_BITS_PER_INT_LOG2 5 |
|
549 #define PR_BITS_PER_INT64_LOG2 6 |
|
550 #define PR_BITS_PER_LONG_LOG2 5 |
|
551 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
552 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
553 #define PR_BITS_PER_WORD_LOG2 5 |
|
554 |
|
555 #define PR_ALIGN_OF_SHORT 2 |
|
556 #define PR_ALIGN_OF_INT 4 |
|
557 #define PR_ALIGN_OF_LONG 4 |
|
558 #define PR_ALIGN_OF_INT64 4 |
|
559 #define PR_ALIGN_OF_FLOAT 4 |
|
560 #define PR_ALIGN_OF_DOUBLE 4 |
|
561 #define PR_ALIGN_OF_POINTER 4 |
|
562 #define PR_ALIGN_OF_WORD 4 |
|
563 |
|
564 #define PR_BYTES_PER_WORD_LOG2 2 |
|
565 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
566 |
|
567 #elif defined(__hppa__) |
|
568 |
|
569 #undef IS_LITTLE_ENDIAN |
|
570 #define IS_BIG_ENDIAN 1 |
|
571 |
|
572 #define PR_BYTES_PER_BYTE 1 |
|
573 #define PR_BYTES_PER_SHORT 2 |
|
574 #define PR_BYTES_PER_INT 4 |
|
575 #define PR_BYTES_PER_INT64 8 |
|
576 #define PR_BYTES_PER_LONG 4 |
|
577 #define PR_BYTES_PER_FLOAT 4 |
|
578 #define PR_BYTES_PER_DOUBLE 8 |
|
579 #define PR_BYTES_PER_WORD 4 |
|
580 #define PR_BYTES_PER_DWORD 8 |
|
581 |
|
582 #define PR_BITS_PER_BYTE 8 |
|
583 #define PR_BITS_PER_SHORT 16 |
|
584 #define PR_BITS_PER_INT 32 |
|
585 #define PR_BITS_PER_INT64 64 |
|
586 #define PR_BITS_PER_LONG 32 |
|
587 #define PR_BITS_PER_FLOAT 32 |
|
588 #define PR_BITS_PER_DOUBLE 64 |
|
589 #define PR_BITS_PER_WORD 32 |
|
590 |
|
591 #define PR_BITS_PER_BYTE_LOG2 3 |
|
592 #define PR_BITS_PER_SHORT_LOG2 4 |
|
593 #define PR_BITS_PER_INT_LOG2 5 |
|
594 #define PR_BITS_PER_INT64_LOG2 6 |
|
595 #define PR_BITS_PER_LONG_LOG2 5 |
|
596 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
597 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
598 #define PR_BITS_PER_WORD_LOG2 5 |
|
599 |
|
600 #define PR_ALIGN_OF_SHORT 2 |
|
601 #define PR_ALIGN_OF_INT 4 |
|
602 #define PR_ALIGN_OF_LONG 4 |
|
603 #define PR_ALIGN_OF_INT64 8 |
|
604 #define PR_ALIGN_OF_FLOAT 4 |
|
605 #define PR_ALIGN_OF_DOUBLE 8 |
|
606 #define PR_ALIGN_OF_POINTER 4 |
|
607 #define PR_ALIGN_OF_WORD 4 |
|
608 |
|
609 #define PR_BYTES_PER_WORD_LOG2 2 |
|
610 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
611 |
|
612 #elif defined(__s390x__) |
|
613 |
|
614 #define IS_BIG_ENDIAN 1 |
|
615 #undef IS_LITTLE_ENDIAN |
|
616 #define IS_64 |
|
617 |
|
618 #define PR_BYTES_PER_BYTE 1 |
|
619 #define PR_BYTES_PER_SHORT 2 |
|
620 #define PR_BYTES_PER_INT 4 |
|
621 #define PR_BYTES_PER_INT64 8 |
|
622 #define PR_BYTES_PER_LONG 8 |
|
623 #define PR_BYTES_PER_FLOAT 4 |
|
624 #define PR_BYTES_PER_DOUBLE 8 |
|
625 #define PR_BYTES_PER_WORD 8 |
|
626 #define PR_BYTES_PER_DWORD 8 |
|
627 |
|
628 #define PR_BITS_PER_BYTE 8 |
|
629 #define PR_BITS_PER_SHORT 16 |
|
630 #define PR_BITS_PER_INT 32 |
|
631 #define PR_BITS_PER_INT64 64 |
|
632 #define PR_BITS_PER_LONG 64 |
|
633 #define PR_BITS_PER_FLOAT 32 |
|
634 #define PR_BITS_PER_DOUBLE 64 |
|
635 #define PR_BITS_PER_WORD 64 |
|
636 |
|
637 #define PR_BITS_PER_BYTE_LOG2 3 |
|
638 #define PR_BITS_PER_SHORT_LOG2 4 |
|
639 #define PR_BITS_PER_INT_LOG2 5 |
|
640 #define PR_BITS_PER_INT64_LOG2 6 |
|
641 #define PR_BITS_PER_LONG_LOG2 6 |
|
642 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
643 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
644 #define PR_BITS_PER_WORD_LOG2 6 |
|
645 |
|
646 #define PR_ALIGN_OF_SHORT 2 |
|
647 #define PR_ALIGN_OF_INT 4 |
|
648 #define PR_ALIGN_OF_LONG 8 |
|
649 #define PR_ALIGN_OF_INT64 8 |
|
650 #define PR_ALIGN_OF_FLOAT 4 |
|
651 #define PR_ALIGN_OF_DOUBLE 8 |
|
652 #define PR_ALIGN_OF_POINTER 8 |
|
653 #define PR_ALIGN_OF_WORD 8 |
|
654 |
|
655 #define PR_BYTES_PER_WORD_LOG2 3 |
|
656 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
657 |
|
658 #elif defined(__s390__) |
|
659 |
|
660 #define IS_BIG_ENDIAN 1 |
|
661 #undef IS_LITTLE_ENDIAN |
|
662 |
|
663 #define PR_BYTES_PER_BYTE 1 |
|
664 #define PR_BYTES_PER_SHORT 2 |
|
665 #define PR_BYTES_PER_INT 4 |
|
666 #define PR_BYTES_PER_INT64 8 |
|
667 #define PR_BYTES_PER_LONG 4 |
|
668 #define PR_BYTES_PER_FLOAT 4 |
|
669 #define PR_BYTES_PER_DOUBLE 8 |
|
670 #define PR_BYTES_PER_WORD 4 |
|
671 #define PR_BYTES_PER_DWORD 8 |
|
672 |
|
673 #define PR_BITS_PER_BYTE 8 |
|
674 #define PR_BITS_PER_SHORT 16 |
|
675 #define PR_BITS_PER_INT 32 |
|
676 #define PR_BITS_PER_INT64 64 |
|
677 #define PR_BITS_PER_LONG 32 |
|
678 #define PR_BITS_PER_FLOAT 32 |
|
679 #define PR_BITS_PER_DOUBLE 64 |
|
680 #define PR_BITS_PER_WORD 32 |
|
681 |
|
682 #define PR_BITS_PER_BYTE_LOG2 3 |
|
683 #define PR_BITS_PER_SHORT_LOG2 4 |
|
684 #define PR_BITS_PER_INT_LOG2 5 |
|
685 #define PR_BITS_PER_INT64_LOG2 6 |
|
686 #define PR_BITS_PER_LONG_LOG2 5 |
|
687 #define PR_BITS_PER_FLOAT_LOG2 5 |
|
688 #define PR_BITS_PER_DOUBLE_LOG2 6 |
|
689 #define PR_BITS_PER_WORD_LOG2 5 |
|
690 |
|
691 #define PR_ALIGN_OF_SHORT 2 |
|
692 #define PR_ALIGN_OF_INT 4 |
|
693 #define PR_ALIGN_OF_LONG 4 |
|
694 #define PR_ALIGN_OF_INT64 4 |
|
695 #define PR_ALIGN_OF_FLOAT 4 |
|
696 #define PR_ALIGN_OF_DOUBLE 4 |
|
697 #define PR_ALIGN_OF_POINTER 4 |
|
698 #define PR_ALIGN_OF_WORD 4 |
|
699 |
|
700 #define PR_BYTES_PER_WORD_LOG2 2 |
|
701 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
702 |
|
703 #else |
|
704 |
|
705 #error "Unknown CPU architecture" |
|
706 |
|
707 #endif |
|
708 |
|
709 #ifndef HAVE_LONG_LONG |
|
710 #define HAVE_LONG_LONG |
|
711 #endif |
|
712 #if PR_ALIGN_OF_DOUBLE == 8 |
|
713 #define HAVE_ALIGNED_DOUBLES |
|
714 #endif |
|
715 #if PR_ALIGN_OF_INT64 == 8 |
|
716 #define HAVE_ALIGNED_LONGLONGS |
|
717 #endif |
|
718 |
|
719 #ifndef NO_NSPR_10_SUPPORT |
|
720 |
|
721 #define BYTES_PER_BYTE PR_BYTES_PER_BYTE |
|
722 #define BYTES_PER_SHORT PR_BYTES_PER_SHORT |
|
723 #define BYTES_PER_INT PR_BYTES_PER_INT |
|
724 #define BYTES_PER_INT64 PR_BYTES_PER_INT64 |
|
725 #define BYTES_PER_LONG PR_BYTES_PER_LONG |
|
726 #define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT |
|
727 #define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE |
|
728 #define BYTES_PER_WORD PR_BYTES_PER_WORD |
|
729 #define BYTES_PER_DWORD PR_BYTES_PER_DWORD |
|
730 |
|
731 #define BITS_PER_BYTE PR_BITS_PER_BYTE |
|
732 #define BITS_PER_SHORT PR_BITS_PER_SHORT |
|
733 #define BITS_PER_INT PR_BITS_PER_INT |
|
734 #define BITS_PER_INT64 PR_BITS_PER_INT64 |
|
735 #define BITS_PER_LONG PR_BITS_PER_LONG |
|
736 #define BITS_PER_FLOAT PR_BITS_PER_FLOAT |
|
737 #define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE |
|
738 #define BITS_PER_WORD PR_BITS_PER_WORD |
|
739 |
|
740 #define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 |
|
741 #define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 |
|
742 #define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 |
|
743 #define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 |
|
744 #define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 |
|
745 #define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 |
|
746 #define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 |
|
747 #define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 |
|
748 |
|
749 #define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT |
|
750 #define ALIGN_OF_INT PR_ALIGN_OF_INT |
|
751 #define ALIGN_OF_LONG PR_ALIGN_OF_LONG |
|
752 #define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 |
|
753 #define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT |
|
754 #define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE |
|
755 #define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER |
|
756 #define ALIGN_OF_WORD PR_ALIGN_OF_WORD |
|
757 |
|
758 #define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 |
|
759 #define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 |
|
760 #define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 |
|
761 |
|
762 #endif /* NO_NSPR_10_SUPPORT */ |
|
763 |
|
764 #endif /* nspr_cpucfg___ */ |
|