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