forked from osmocom/wireshark
parent
874ff29b40
commit
2b3b994b01
|
@ -652,31 +652,31 @@ do_cpuid(guint32 *CPUInfo, int selector _U_){
|
||||||
static void get_cpu_info(GString *str _U_)
|
static void get_cpu_info(GString *str _U_)
|
||||||
{
|
{
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
int CPUInfo[4];
|
int CPUInfo[4];
|
||||||
#else
|
#else
|
||||||
guint32 CPUInfo[4];
|
guint32 CPUInfo[4];
|
||||||
#endif
|
#endif
|
||||||
char CPUBrandString[0x40];
|
char CPUBrandString[0x40];
|
||||||
unsigned nExIds;
|
unsigned nExIds;
|
||||||
|
|
||||||
/* http://msdn.microsoft.com/en-us/library/hskdteyh(v=vs.100).aspx */
|
/* http://msdn.microsoft.com/en-us/library/hskdteyh(v=vs.100).aspx */
|
||||||
|
|
||||||
/* Calling __cpuid with 0x80000000 as the InfoType argument*/
|
/* Calling __cpuid with 0x80000000 as the InfoType argument*/
|
||||||
/* gets the number of valid extended IDs.*/
|
/* gets the number of valid extended IDs.*/
|
||||||
do_cpuid(CPUInfo, 0x80000000);
|
do_cpuid(CPUInfo, 0x80000000);
|
||||||
nExIds = CPUInfo[0];
|
nExIds = CPUInfo[0];
|
||||||
|
|
||||||
if( nExIds<0x80000005)
|
if( nExIds<0x80000005)
|
||||||
return;
|
return;
|
||||||
memset(CPUBrandString, 0, sizeof(CPUBrandString));
|
memset(CPUBrandString, 0, sizeof(CPUBrandString));
|
||||||
|
|
||||||
/* Interpret CPU brand string.*/
|
/* Interpret CPU brand string.*/
|
||||||
do_cpuid(CPUInfo, 0x80000002);
|
do_cpuid(CPUInfo, 0x80000002);
|
||||||
memcpy(CPUBrandString, CPUInfo, sizeof(CPUInfo));
|
memcpy(CPUBrandString, CPUInfo, sizeof(CPUInfo));
|
||||||
do_cpuid(CPUInfo, 0x80000003);
|
do_cpuid(CPUInfo, 0x80000003);
|
||||||
memcpy(CPUBrandString + 16, CPUInfo, sizeof(CPUInfo));
|
memcpy(CPUBrandString + 16, CPUInfo, sizeof(CPUInfo));
|
||||||
do_cpuid(CPUInfo, 0x80000004);
|
do_cpuid(CPUInfo, 0x80000004);
|
||||||
memcpy(CPUBrandString + 32, CPUInfo, sizeof(CPUInfo));
|
memcpy(CPUBrandString + 32, CPUInfo, sizeof(CPUInfo));
|
||||||
|
|
||||||
g_string_append_printf(str, "\n%s", CPUBrandString);
|
g_string_append_printf(str, "\n%s", CPUBrandString);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue