win-pvdrivers

view liblfds.6/test/src/abstraction.h @ 1025:aa2e51f67f7c

Fix hibernate under Win8. Change debugprints.
author James Harper <james.harper@bendigoit.com.au>
date Tue Feb 19 15:14:53 2013 +1100 (2013-02-19)
parents 6300617040e0
children
line source
1 /***** defines *****/
2 #if (defined _WIN32 && defined _MSC_VER && !defined WIN_KERNEL_BUILD)
3 /* TRD : any Windows (user-mode) on any CPU with the Microsoft C compiler
5 _WIN32 indicates 64-bit or 32-bit Windows
6 _MSC_VER indicates Microsoft C compiler
7 !WIN_KERNEL_BUILD indicates Windows user-mode
8 */
10 #include <windows.h>
11 typedef HANDLE thread_state_t;
12 typedef DWORD thread_return_t;
13 #define CALLING_CONVENTION WINAPI
14 #endif
16 #if (defined _WIN32 && defined _MSC_VER && defined WIN_KERNEL_BUILD)
17 /* TRD : any Windows (kernel-mode) on any CPU with the Microsoft C compiler
19 _WIN32 indicates 64-bit or 32-bit Windows
20 _MSC_VER indicates Microsoft C compiler
21 WIN_KERNEL_BUILD indicates Windows kernel
22 */
24 #include <wdm.h>
25 typedef HANDLE thread_state_t;
26 typedef VOID thread_return_t;
27 #define CALLING_CONVENTION
28 #endif
30 #if (defined __unix__ && __GNUC__)
31 /* TRD : any UNIX on any CPU with GCC
33 __unix__ indicates Solaris, Linux, HPUX, etc
34 __GNUC__ indicates GCC
35 */
37 #include <unistd.h>
38 #include <pthread.h>
39 typedef pthread_t thread_state_t;
40 typedef void * thread_return_t;
41 #define CALLING_CONVENTION
42 #endif
44 typedef thread_return_t (CALLING_CONVENTION *thread_function_t)( void *thread_user_state );
46 /***** public prototypes *****/
47 unsigned int abstraction_cpu_count( void );
48 int abstraction_thread_start( thread_state_t *thread_state, unsigned int cpu, thread_function_t thread_function, void *thread_user_state );
49 void abstraction_thread_wait( thread_state_t thread_state );