1 /****************************************************************************/
2 #if( defined _WIN32 && NTDDI_VERSION >= NTDDI_WINXP && !defined KERNEL_MODE )
4 #ifdef LIBSHARED_PAL_OPERATING_SYSTEM
5 #error More than one porting abstraction layer matches current platform in "libshared_porting_abstraction_layer_operating_system.h".
8 #define LIBSHARED_PAL_OPERATING_SYSTEM
10 #define LIBSHARED_PAL_OS_STRING "Windows"
14 typedef HANDLE libshared_pal_thread_handle_t;
15 typedef DWORD libshared_pal_thread_return_t;
17 #define LIBSHARED_PAL_THREAD_CALLING_CONVENTION WINAPI
18 #define LIBSHARED_PAL_THREAD_RETURN_TYPE libshared_pal_thread_return_t
19 #define LIBSHARED_PAL_THREAD_RETURN_CAST( return_value ) return_value
27 /****************************************************************************/
28 #if( defined _WIN32 && NTDDI_VERSION >= NTDDI_WINXP && defined KERNEL_MODE )
30 #ifdef LIBSHARED_PAL_OPERATING_SYSTEM
31 #error More than one porting abstraction layer matches current platform in "libshared_porting_abstraction_layer_operating_system.h".
34 #define LIBSHARED_PAL_OPERATING_SYSTEM
36 #define LIBSHARED_PAL_OS_STRING "Windows"
40 typedef HANDLE libshared_pal_thread_handle_t;
41 typedef VOID libshared_pal_thread_return_t;
43 #define LIBSHARED_PAL_THREAD_CALLING_CONVENTION
44 #define LIBSHARED_PAL_THREAD_RETURN_TYPE int
45 #define LIBSHARED_PAL_THREAD_RETURN_CAST( return_value )
53 /****************************************************************************/
54 #if( defined __linux__ && !defined KERNEL_MODE )
56 #ifdef LIBSHARED_PAL_OPERATING_SYSTEM
57 #error More than one porting abstraction layer matches current platform in "libshared_porting_abstraction_layer_operating_system.h".
60 #define LIBSHARED_PAL_OPERATING_SYSTEM
65 #define LIBSHARED_PAL_OS_STRING "Linux"
67 #if( _POSIX_THREADS >= 0 )
70 #include <sys/syscall.h>
71 #include <sys/types.h>
73 typedef pthread_t libshared_pal_thread_handle_t;
74 typedef void * libshared_pal_thread_return_t;
76 #define LIBSHARED_PAL_THREAD_CALLING_CONVENTION
77 #define LIBSHARED_PAL_THREAD_RETURN_TYPE libshared_pal_thread_return_t
78 #define LIBSHARED_PAL_THREAD_RETURN_CAST( return_value ) ( (libshared_pal_thread_return_t) (return_value) )
81 #if( _POSIX_THREADS == -1 )
82 #error No pthread support under Linux in libshared_porting_abstraction_layer_operating_system.h
91 /****************************************************************************/
92 #if( defined __linux__ && defined KERNEL_MODE )
94 #ifdef LIBSHARED_PAL_OPERATING_SYSTEM
95 #error More than one porting abstraction layer matches current platform. in "libshared_porting_abstraction_layer_operating_system.h".
98 #define LIBSHARED_PAL_OPERATING_SYSTEM
100 #define LIBSHARED_PAL_OS_STRING "Linux"
104 #include <linux/module.h>
105 #include <linux/kthread.h>
107 typedef struct task_struct * libshared_pal_thread_handle_t;
108 typedef int libshared_pal_thread_return_t;
110 #define LIBSHARED_PAL_THREAD_CALLING_CONVENTION
111 #define LIBSHARED_PAL_THREAD_RETURN_TYPE libshared_pal_thread_return_t
112 #define LIBSHARED_PAL_THREAD_RETURN_CAST( return_value ) ( (libshared_pal_thread_return_t) (return_value) )
120 /****************************************************************************/
121 #if( !defined LIBSHARED_PAL_OPERATING_SYSTEM )
123 #error No matching porting abstraction layer in "libshared_porting_abstraction_layer_operating_system.h".