From e0d48debedfa27a7a31dd1caf8e23cf71708cf4c Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 13 Aug 2015 17:59:47 +0200 Subject: Fix /proc/cpuinfo topology and cache size info * autoload.cc (GetLogicalProcessorInformationEx): Import. (SetThreadGroupAffinity): Import. * fhandler_proc.cc (add_size): New macro. (get_msb): New inline function. (mask_bits): Ditto. (format_proc_cpuinfo): Drop handling of old CPUs. Check if we're running on a OS version supporting porcessor groups. If so, use SetThreadGroupAffinity to set thread affinity. Improve cache info to include 3rd level cache on Intel CPUs. Improve multi core info. * wincap.h (wincaps::has_processor_groups): New element. * wincap.cc: Implement above element throughout. Signed-off-by: Corinna Vinschen --- winsup/cygwin/wincap.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'winsup/cygwin/wincap.cc') diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index 78baa6824..92d47d367 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -49,6 +49,7 @@ wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = { has_microsoft_accounts:false, has_set_thread_stack_guarantee:false, has_broken_rtl_query_process_debug_information:false, + has_processor_groups:false, }; wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = { @@ -80,6 +81,7 @@ wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = { has_microsoft_accounts:false, has_set_thread_stack_guarantee:true, has_broken_rtl_query_process_debug_information:true, + has_processor_groups:false, }; wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = { @@ -111,6 +113,7 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = { has_microsoft_accounts:false, has_set_thread_stack_guarantee:true, has_broken_rtl_query_process_debug_information:false, + has_processor_groups:false, }; wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = { @@ -142,6 +145,7 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = { has_microsoft_accounts:false, has_set_thread_stack_guarantee:true, has_broken_rtl_query_process_debug_information:false, + has_processor_groups:true, }; wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = { @@ -173,6 +177,7 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = { has_microsoft_accounts:true, has_set_thread_stack_guarantee:true, has_broken_rtl_query_process_debug_information:false, + has_processor_groups:true, }; wincaps wincap_10 __attribute__((section (".cygwin_dll_common"), shared)) = { @@ -204,6 +209,7 @@ wincaps wincap_10 __attribute__((section (".cygwin_dll_common"), shared)) = { has_microsoft_accounts:true, has_set_thread_stack_guarantee:true, has_broken_rtl_query_process_debug_information:false, + has_processor_groups:true, }; wincapc wincap __attribute__((section (".cygwin_dll_common"), shared)); -- cgit v1.2.3