]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.1.0/test_and_benchmark/libtest/inc/libtest/libtest_porting_abstraction_layer_compiler.h
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.1.0 / test_and_benchmark / libtest / inc / libtest / libtest_porting_abstraction_layer_compiler.h
1 /****************************************************************************/
2 #if( defined __GNUC__ )
3
4   #ifdef LIBTEST_PAL_COMPILER
5     #error More than one porting abstraction layer matches the current platform in "libtest_porting_abstraction_layer_compiler.h".
6   #endif
7
8   #define LIBTEST_PAL_COMPILER
9
10   #if( defined __arm__ )
11     // TRD : lfds710_pal_uint_t destination, lfds710_pal_uint_t *source
12     #define LIBTEST_PAL_LOAD_LINKED( destination, source )  \
13     {                                                       \
14       __asm__ __volatile__                                  \
15       (                                                     \
16         "ldrex  %[alias_dst], [%[alias_src]];"              \
17         : [alias_dst] "=r" (destination)                    \
18         : [alias_src] "r" (source)                          \
19       );                                                    \
20     }
21
22     // TRD : lfds710_pal_uint_t *destination, lfds710_pal_uint_t source, lfds710_pal_uint_t stored_flag
23     #define LIBTEST_PAL_STORE_CONDITIONAL( destination, source, stored_flag )    \
24     {                                                                            \
25       __asm__ __volatile__                                                       \
26       (                                                                          \
27         "strex  %[alias_sf], %[alias_src], [%[alias_dst]];"                      \
28         : "=m" (*destination),                                                   \
29           [alias_sf] "=&r" (stored_flag)                                         \
30         : [alias_src] "r" (source),                                              \
31           [alias_dst] "r" (destination)                                          \
32       );                                                                         \
33     }
34   #endif
35
36 #endif
37
38
39
40
41
42 /****************************************************************************/
43 #if( defined _WIN32 && defined KERNEL_MODE && defined _M_IX86 )
44
45   #define LIBTEST_PAL_PROCESSOR
46
47   // TRD : bloody x86 on MSVC...
48
49   #define LIBTEST_PAL_STDLIB_CALLBACK_CALLING_CONVENTION  __cdecl
50
51 #endif
52
53
54
55
56
57 /****************************************************************************/
58 #if( !defined LIBTEST_PAL_PROCESSOR )
59
60   #define LIBTEST_PAL_STDLIB_CALLBACK_CALLING_CONVENTION
61
62 #endif
63