diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-06-21 13:20:18 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-06-21 20:21:03 +0000 |
commit | 00f23a4f5c21377c2a1421bbe884518e14898a88 (patch) | |
tree | 8e6e4993bd1abb7129d694eb5107dde5bb166126 /version_info.c | |
parent | 9e8fb87a3eec510f0b6117af029dbc3651ef9c30 (diff) |
Move the routine to get a CPU information string to wsutil.
Change-Id: Ibf6e57d7382cbbd831a0367fd48d684118712408
Reviewed-on: https://code.wireshark.org/review/2523
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'version_info.c')
-rw-r--r-- | version_info.c | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/version_info.c b/version_info.c index 67d4139b76..763a122038 100644 --- a/version_info.c +++ b/version_info.c @@ -33,10 +33,9 @@ #include "version_info.h" #include "capture-pcap-util.h" -#include <wsutil/unicode-utils.h> -#include <wsutil/ws_cpuid.h> #include <wsutil/os_version_info.h> #include <wsutil/compiler_info.h> +#include <wsutil/cpu_info.h> #include "version.h" @@ -169,42 +168,6 @@ get_compiled_version_info(GString *str, void (*prepend_info)(GString *), end_string(str); } -/* - * Get the CPU info, and append it to the GString - */ - -static void get_cpu_info(GString *str _U_) -{ - guint32 CPUInfo[4]; - char CPUBrandString[0x40]; - unsigned nExIds; - - /* http://msdn.microsoft.com/en-us/library/hskdteyh(v=vs.100).aspx */ - - /* Calling __cpuid with 0x80000000 as the InfoType argument*/ - /* gets the number of valid extended IDs.*/ - if (!ws_cpuid(CPUInfo, 0x80000000)) - return; - nExIds = CPUInfo[0]; - - if( nExIds<0x80000005) - return; - memset(CPUBrandString, 0, sizeof(CPUBrandString)); - - /* Interpret CPU brand string.*/ - ws_cpuid(CPUInfo, 0x80000002); - memcpy(CPUBrandString, CPUInfo, sizeof(CPUInfo)); - ws_cpuid(CPUInfo, 0x80000003); - memcpy(CPUBrandString + 16, CPUInfo, sizeof(CPUInfo)); - ws_cpuid(CPUInfo, 0x80000004); - memcpy(CPUBrandString + 32, CPUInfo, sizeof(CPUInfo)); - - g_string_append_printf(str, "\n%s", CPUBrandString); - - if (ws_cpuid_sse42()) - g_string_append(str, " (with SSE4.2)"); -} - static void get_mem_info(GString *str _U_) { #if defined(_WIN32) |