]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.1.0/test_and_benchmark/benchmark/src/porting_abstraction_layer_operating_system.h
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.1.0 / test_and_benchmark / benchmark / src / porting_abstraction_layer_operating_system.h
1 /****************************************************************************/
2 #if( defined _MSC_VER )
3   /* TRD : MSVC compiler
4
5            an unfortunately necessary hack for MSVC
6            MSVC only defines __STDC__ if /Za is given, where /Za turns off MSVC C extensions - 
7            which prevents Windows header files from compiling.
8   */
9
10   #define __STDC__         1
11   #define __STDC_HOSTED__  1
12 #endif
13
14
15
16
17
18 /****************************************************************************/
19 #if( defined _WIN32 && NTDDI_VERSION < NTDDI_VISTA )
20
21   #ifdef BENCHMARK_PAL_OPERATING_SYSTEM
22     #error More than one porting abstraction layer matches current platform.
23   #endif
24
25   #define BENCHMARK_PAL_OPERATING_SYSTEM
26
27   #define BENCHMARK_PAL_OS_STRING           "Windows"
28   #define BENCHMARK_PAL_MEMORY_TYPE         BENCHMARK_MEMORY_TYPE_SMP
29   #define BENCHMARK_PAL_MEMORY_TYPE_STRING  "SMP"
30
31 #endif
32
33
34
35
36
37 /****************************************************************************/
38 #if( defined _WIN32 && NTDDI_VERSION >= NTDDI_VISTA )
39
40   #ifdef BENCHMARK_PAL_OPERATING_SYSTEM
41     #error More than one porting abstraction layer matches current platform.
42   #endif
43
44   #define BENCHMARK_PAL_OPERATING_SYSTEM
45
46   #define BENCHMARK_PAL_OS_STRING           "Windows"
47   #define BENCHMARK_PAL_MEMORY_TYPE         BENCHMARK_MEMORY_TYPE_NUMA
48   #define BENCHMARK_PAL_MEMORY_TYPE_STRING  "NUMA"
49
50 #endif
51
52
53
54
55
56 /****************************************************************************/
57 #if( defined __linux__ && !defined KERNEL_MODE && !defined LIBNUMA )
58
59   #ifdef BENCHMARK_PAL_OPERATING_SYSTEM
60     #error More than one porting abstraction layer matches current platform.
61   #endif
62
63   #define BENCHMARK_PAL_OPERATING_SYSTEM
64
65   #define BENCHMARK_PAL_OS_STRING           "Linux"
66   #define BENCHMARK_PAL_MEMORY_TYPE         BENCHMARK_MEMORY_TYPE_SMP
67   #define BENCHMARK_PAL_MEMORY_TYPE_STRING  "SMP"
68
69   #include <unistd.h>
70   #if( _POSIX_MEMLOCK_RANGE > 0 )
71     #include <sys/mman.h>
72   #endif
73
74 #endif
75
76
77
78
79
80 /****************************************************************************/
81 #if( defined __linux__ && !defined KERNEL_MODE && defined LIBNUMA )
82
83   #ifdef BENCHMARK_PAL_OPERATING_SYSTEM
84     #error More than one porting abstraction layer matches current platform.
85   #endif
86
87   #define BENCHMARK_PAL_OPERATING_SYSTEM
88
89   #define BENCHMARK_PAL_OS_STRING           "Linux"
90   #define BENCHMARK_PAL_MEMORY_TYPE         BENCHMARK_MEMORY_TYPE_NUMA
91   #define BENCHMARK_PAL_MEMORY_TYPE_STRING  "NUMA"
92
93   #include <unistd.h>
94   #include <numa.h>
95   #if( _POSIX_MEMLOCK_RANGE > 0 )
96     #include <sys/mman.h>
97   #endif
98
99 #endif
100
101
102
103
104
105 /****************************************************************************/
106 #if( !defined BENCHMARK_PAL_OPERATING_SYSTEM )
107
108   #error No operating system porting abstraction layer.
109
110 #endif
111