diff --git a/cpudetect.c b/cpudetect.c index b2dea783f0..15151ae873 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -1,6 +1,8 @@ #include "config.h" #include "cpudetect.h" +CpuCaps gCpuCaps; + #ifdef ARCH_X86 #include @@ -22,7 +24,6 @@ /* I believe this code works. However, it has only been used on a PII and PIII */ -CpuCaps gCpuCaps; static void check_os_katmai_support( void ); #if 1 @@ -83,7 +84,9 @@ void GetCpuCaps( CpuCaps *caps) { unsigned int regs[4]; unsigned int regs2[4]; - + + caps->isX86=1; + bzero(caps, sizeof(*caps)); if (!has_cpuid()) { printf("CPUID not supported!???\n"); @@ -94,7 +97,7 @@ void GetCpuCaps( CpuCaps *caps) if (regs[0]>=0x00000001) { char *tmpstr; - + do_cpuid(0x00000001, regs2); tmpstr=GetCpuFriendlyName(regs, regs2); @@ -142,7 +145,9 @@ void GetCpuCaps( CpuCaps *caps) caps->hasSSE=0; caps->hasSSE2 = 0; #endif - +// caps->has3DNow=1; +// caps->hasMMX2 = 0; +// caps->hasMMX = 0; } @@ -166,7 +171,7 @@ char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]){ } sprintf(vendor,"%.4s%.4s%.4s",®s[1],®s[3],®s[2]); - + for(i=0; icpuType=0; + caps->hasMMX=0; + caps->hasMMX2=0; + caps->has3DNow=0; + caps->has3DNowExt=0; + caps->hasSSE=0; + caps->hasSSE2=0; + caps->isX86=0; +} +#endif /* !ARCH_X86 */ diff --git a/cpudetect.h b/cpudetect.h index 868e6720c5..ccdfb246e8 100644 --- a/cpudetect.h +++ b/cpudetect.h @@ -1,4 +1,5 @@ -#ifdef ARCH_X86 +#ifndef CPUDETECT_H +#define CPUDETECT_H #define CPUTYPE_I386 3 #define CPUTYPE_I486 4 @@ -13,6 +14,7 @@ typedef struct cpucaps_s { int has3DNowExt; int hasSSE; int hasSSE2; + int isX86; } CpuCaps; extern CpuCaps gCpuCaps; @@ -22,5 +24,5 @@ void GetCpuCaps(CpuCaps *caps); /* returned value is malloc()'ed so free() it after use */ char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]); -#endif /* ARCH_X86 */ +#endif /* !CPUDETECT_H */