7 /****************************************************************************/
8 #if (defined _WIN32 && defined _MSC_VER && !defined WIN_KERNEL_BUILD)
10 /* TRD : any Windows (user-mode) on any CPU with the Microsoft C compiler
12 _WIN32 indicates 64-bit or 32-bit Windows
13 _MSC_VER indicates Microsoft C compiler
14 !WIN_KERNEL_BUILD indicates Windows user-mode
17 unsigned int abstraction_cpu_count()
22 GetNativeSystemInfo( &si );
24 return( (unsigned int) si.dwNumberOfProcessors );
33 /****************************************************************************/
34 #if (defined _WIN32 && defined _MSC_VER && defined WIN_KERNEL_BUILD)
36 /* TRD : any Windows on any CPU with the Microsoft C compiler
38 _WIN32 indicates 64-bit or 32-bit Windows
39 _MSC_VER indicates Microsoft C compiler
40 WIN_KERNEL_BUILD indicates Windows kernel
43 unsigned int abstraction_cpu_count()
46 active_processor_count;
48 active_processor_count = KeQueryActiveProcessorCount( NULL );
50 return( active_processor_count );
59 /****************************************************************************/
60 #if (defined __linux__ && defined __GNUC__)
62 /* TRD : Linux on any CPU with GCC
64 this function I believe is Linux specific and varies by UNIX flavour
66 __linux__ indicates Linux
67 __GNUC__ indicates GCC
70 unsigned int abstraction_cpu_count()
75 cpu_count = sysconf( _SC_NPROCESSORS_ONLN );
77 return( (unsigned int) cpu_count );