]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_porting_abstraction_layer_processor.h
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.0.0 / liblfds700 / inc / liblfds700 / lfds700_porting_abstraction_layer_processor.h
1 /****************************************************************************/
2 #if( defined _MSC_VER && _MSC_VER >= 1400 && defined _M_IX86 )
3
4   /* TRD : MSVC, x86
5            x86 is CAS, so isolation is cache-line length
6   */
7
8   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
9     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
10   #endif
11
12   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
13
14   typedef int long unsigned lfds700_pal_atom_t;
15   typedef int long unsigned lfds700_pal_uint_t;
16
17   #define LFDS700_PAL_PROCESSOR_STRING            "x86"
18
19   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        4
20   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        8
21
22   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  32
23   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   32
24
25 #endif
26
27
28
29
30
31 /****************************************************************************/
32 #if( defined _MSC_VER && _MSC_VER >= 1400 && (defined _M_X64 || defined _M_AMD64) )
33
34   /* TRD : MSVC, x64
35            x64 is CAS, so isolation is cache-line length
36   */
37
38   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
39     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
40   #endif
41
42   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
43
44   typedef int long long unsigned lfds700_pal_atom_t;
45   typedef int long long unsigned lfds700_pal_uint_t;
46
47   #define LFDS700_PAL_PROCESSOR_STRING            "x64"
48
49   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        8
50   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        16
51
52   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  64
53   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   64
54
55 #endif
56
57
58
59
60
61 /****************************************************************************/
62 #if( defined _MSC_VER && _MSC_VER >= 1400 && defined _M_IA64 )
63
64   /* TRD : MSVC, Itanium
65            IA64 is CAS, so isolation is cache-line length
66   */
67
68   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
69     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
70   #endif
71
72   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
73
74   typedef int long long unsigned lfds700_pal_atom_t;
75   typedef int long long unsigned lfds700_pal_uint_t;
76
77   #define LFDS700_PAL_PROCESSOR_STRING            "IA64"
78
79   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        8
80   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        16
81
82   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  64
83   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   64
84
85 #endif
86
87
88
89
90
91   /****************************************************************************/
92 #if( defined _MSC_VER && _MSC_VER >= 1400 && defined _M_ARM )
93
94   /* TRD : MSVC, 32-bit ARM
95
96   ARM is LL/SC and uses a reservation granule of 8 to 2048 bytes
97   so the isolation value used here is worst-case - be sure to set
98   this correctly, otherwise structures are painfully large
99   */
100
101 #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
102 #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
103 #endif
104
105 #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
106
107   typedef int long unsigned lfds700_pal_atom_t;
108   typedef int long unsigned lfds700_pal_uint_t;
109
110 #define LFDS700_PAL_PROCESSOR_STRING            "ARM (32-bit)"
111
112 #define LFDS700_PAL_ALIGN_SINGLE_POINTER        4
113 #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        8
114
115 #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  32
116 #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   2048
117
118 #endif
119   
120   
121   
122   
123   
124 /****************************************************************************/
125 #if( defined __GNUC__ && defined __arm__ )
126
127   /* TRD : GCC, 32-bit ARM
128
129            ARM is LL/SC and uses a reservation granule of 8 to 2048 bytes
130            so the isolation value used here is worst-case - be sure to set
131            this correctly, otherwise structures are painfully large
132   */
133
134   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
135     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
136   #endif
137
138   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
139
140   typedef int long unsigned lfds700_pal_atom_t;
141   typedef int long unsigned lfds700_pal_uint_t;
142
143   #define LFDS700_PAL_PROCESSOR_STRING            "ARM (32-bit)"
144
145   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        4
146   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        8
147
148   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  32
149   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   2048
150
151 #endif
152
153
154
155
156
157 /****************************************************************************/
158 #if( defined __GNUC__ && defined __aarch64__ )
159
160   /* TRD : GCC, 64-bit ARM
161
162            ARM is LL/SC and uses a reservation granule of 8 to 2048 bytes
163            so the isolation value used here is worst-case - be sure to set
164            this correctly, otherwise structures are painfully large
165   */
166
167   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
168     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
169   #endif
170
171   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
172
173   typedef int long long unsigned lfds700_pal_atom_t;
174   typedef int long long unsigned lfds700_pal_uint_t;
175
176   #define LFDS700_PAL_PROCESSOR_STRING            "ARM (64-bit)"
177
178   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        8
179   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        16
180
181   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  64
182   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   2048
183
184 #endif
185
186
187
188
189
190 /****************************************************************************/
191 #if( defined __GNUC__ && (defined __i686__ || defined __i586__ || defined __i486__) )
192
193   /* TRD : GCC, x86
194
195            x86 is CAS, so isolation is cache-line length
196   */
197
198   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
199     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
200   #endif
201
202   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
203
204   typedef int long unsigned lfds700_pal_atom_t;
205   typedef int long unsigned lfds700_pal_uint_t;
206
207   #define LFDS700_PAL_PROCESSOR_STRING            "x86"
208
209   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        4
210   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        8
211
212   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  32
213   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   32
214
215 #endif
216
217
218
219
220
221 /****************************************************************************/
222 #if( defined __GNUC__ && defined __x86_64__ )
223
224   /* TRD : GCC, x86
225
226            x64 is CAS, so isolation is cache-line length
227   */
228
229   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
230     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
231   #endif
232
233   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
234
235   typedef int long long unsigned lfds700_pal_atom_t;
236   typedef int long long unsigned lfds700_pal_uint_t;
237
238   #define LFDS700_PAL_PROCESSOR_STRING            "x64"
239
240   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        8
241   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        16
242
243   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  64
244   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   64
245
246 #endif
247
248
249
250
251
252 /****************************************************************************/
253 #if( defined __GNUC__ && defined __alpha__ )
254
255   /* TRD : GCC, alpha
256
257            alpha is LL/SC, but there is only one reservation per processor,
258            so the isolation value used here is cache-line length
259   */
260
261   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
262     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
263   #endif
264
265   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
266
267   typedef int long unsigned lfds700_pal_atom_t;
268   typedef int long unsigned lfds700_pal_uint_t;
269
270   #define LFDS700_PAL_PROCESSOR_STRING            "alpha"
271
272   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        8
273   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        16
274
275   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  32
276   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   64
277
278 #endif
279
280
281
282
283
284 /****************************************************************************/
285 #if( defined __GNUC__ && defined __ia64__ )
286
287   /* TRD : GCC, Itanium
288
289            Itanium is CAS, so isolation is cache-line length
290   */
291
292   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
293     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
294   #endif
295
296   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
297
298   typedef int long long unsigned lfds700_pal_atom_t;
299   typedef int long long unsigned lfds700_pal_uint_t;
300
301   #define LFDS700_PAL_PROCESSOR_STRING            "IA64"
302
303   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        8
304   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        16
305
306   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  64
307   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   64
308
309 #endif
310
311
312
313
314
315 /****************************************************************************/
316 #if( defined __GNUC__ && defined __mips__ )
317
318   /* TRD : GCC, MIPS (32-bit)
319
320            MIPS is LL/SC, but there is only one reservation per processor,
321            so the isolation value used here is cache-line length
322   */
323
324   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
325     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
326   #endif
327
328   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
329
330   typedef int long unsigned lfds700_pal_atom_t;
331   typedef int long unsigned lfds700_pal_uint_t;
332
333   #define LFDS700_PAL_PROCESSOR_STRING            "MIPS (32-bit)"
334
335   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        4
336   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        8
337
338   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  32
339   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   32
340
341 #endif
342
343
344
345
346
347 /****************************************************************************/
348 #if( defined __GNUC__ && defined __mips64 )
349
350   /* TRD : GCC, MIPS (64-bit)
351
352            MIPS is LL/SC, but there is only one reservation per processor,
353            so the isolation value used here is cache-line length
354   */
355
356   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
357     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
358   #endif
359
360   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
361
362   typedef int long long unsigned lfds700_pal_atom_t;
363   typedef int long long unsigned lfds700_pal_uint_t;
364
365   #define LFDS700_PAL_PROCESSOR_STRING            "MIPS (64-bit)"
366
367   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        8
368   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        16
369
370   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  64
371   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   64
372
373 #endif
374
375
376
377
378
379 /****************************************************************************/
380 #if( defined __GNUC__ && defined __ppc__ )
381
382   /* TRD : GCC, POWERPC (32-bit)
383
384            POWERPC is LL/SC and uses a reservation granule but I can't find
385            canonical documentation for its size - 128 bytes seems to be the
386            largest value I've found
387   */
388
389   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
390     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
391   #endif
392
393   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
394
395   typedef int long unsigned lfds700_pal_atom_t;
396   typedef int long unsigned lfds700_pal_uint_t;
397
398   #define LFDS700_PAL_PROCESSOR_STRING            "POWERPC (32-bit)"
399
400   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        4
401   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        8
402
403   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  32
404   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   128
405
406 #endif
407
408
409
410
411
412 /****************************************************************************/
413 #if( defined __GNUC__ && defined __ppc64__ )
414
415   /* TRD : GCC, POWERPC (64-bit)
416
417            POWERPC is LL/SC and uses a reservation granule but I can't find
418            canonical documentation for its size - 128 bytes seems to be the
419            largest value I've found
420   */
421
422   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
423     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
424   #endif
425
426   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
427
428   typedef int long long unsigned lfds700_pal_atom_t;
429   typedef int long long unsigned lfds700_pal_uint_t;
430
431   #define LFDS700_PAL_PROCESSOR_STRING            "POWERPC (64-bit)"
432
433   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        8
434   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        16
435
436   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  64
437   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   128
438
439 #endif
440
441
442
443
444
445 /****************************************************************************/
446 #if( defined __GNUC__ && defined __sparc__ && !defined __sparc_v9__ )
447
448   /* TRD : GCC, SPARC (32-bit)
449
450            SPARC is CAS, so isolation is cache-line length
451   */
452
453   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
454     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
455   #endif
456
457   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
458
459   typedef int long unsigned lfds700_pal_atom_t;
460   typedef int long unsigned lfds700_pal_uint_t;
461
462   #define LFDS700_PAL_PROCESSOR_STRING            "SPARC (32-bit)"
463
464   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        4
465   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        8
466
467   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  32
468   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   32
469
470 #endif
471
472
473
474
475
476 /****************************************************************************/
477 #if( defined __GNUC__ && defined __sparc__ && defined __sparc_v9__ )
478
479   /* TRD : GCC, SPARC (64-bit)
480
481            SPARC is CAS, so isolation is cache-line length
482   */
483
484   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
485     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
486   #endif
487
488   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
489
490   typedef int long long unsigned lfds700_pal_atom_t;
491   typedef int long long unsigned lfds700_pal_uint_t;
492
493   #define LFDS700_PAL_PROCESSOR_STRING            "SPARC (64-bit)"
494
495   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        8
496   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        16
497
498   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  64
499   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   64
500
501 #endif
502
503
504
505
506
507 /****************************************************************************/
508 #if( defined __GNUC__ && defined __m68k__ )
509
510   /* TRD : GCC, 680x0
511
512            680x0 is CAS, so isolation is cache-line length
513   */
514
515   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
516     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_processor.h
517   #endif
518
519   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR
520
521   typedef int long unsigned lfds700_pal_atom_t;
522   typedef int long unsigned lfds700_pal_uint_t;
523
524   #define LFDS700_PAL_PROCESSOR_STRING            "680x0"
525
526   #define LFDS700_PAL_ALIGN_SINGLE_POINTER        4
527   #define LFDS700_PAL_ALIGN_DOUBLE_POINTER        8
528
529   #define LFDS700_PAL_CACHE_LINE_LENGTH_IN_BYTES  32
530   #define LFDS700_PAL_ATOMIC_ISOLATION_IN_BYTES   32
531
532 #endif
533
534
535
536
537
538 /****************************************************************************/
539 #if( !defined LFDS700_PAL_PORTING_ABSTRACTION_LAYER_PROCESSOR )
540
541   #error No matching porting abstraction layer in lfds700_porting_abstraction_layer_processor.h
542
543 #endif
544