[Mplayer-cvslog] CVS: main/loader win32.c,1.33,1.34

Alex Beregszaszi alex at mplayer.dev.hu
Sun Dec 9 18:04:59 CET 2001


Update of /cvsroot/mplayer/main/loader
In directory mplayer:/var/tmp.root/cvs-serv13707

Modified Files:
	win32.c 
Log Message:
updated cpudetection

Index: win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/win32.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- win32.c	26 Nov 2001 01:17:24 -0000	1.33
+++ win32.c	9 Dec 2001 17:04:55 -0000	1.34
@@ -864,7 +864,6 @@
 	cachedsi.wProcessorLevel		= 5; /* pentium */
 	cachedsi.wProcessorRevision		= 0x0101;
 
-#if 1
 	/* mplayer's way to detect PF's */
 	{
 	    #include "../cpudetect.h"
@@ -876,9 +875,30 @@
 		PF[PF_XMMI_INSTRUCTIONS_AVAILABLE] = TRUE;
 	    if (gCpuCaps.has3DNow)
 		PF[PF_AMD3D_INSTRUCTIONS_AVAILABLE] = TRUE;
+
+	    switch(gCpuCaps.cpuType)
+	    {
+		case CPUTYPE_I686:
+		case CPUTYPE_I586:
+		    cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
+		    cachedsi.wProcessorLevel = 5;
+		    break;
+		case CPUTYPE_I486:
+		    cachedsi.dwProcessorType = PROCESSOR_INTEL_486;
+		    cachedsi.wProcessorLevel = 4;
+		    break;
+		case CPUTYPE_I386:
+		default:
+		    cachedsi.dwProcessorType = PROCESSOR_INTEL_386;
+		    cachedsi.wProcessorLevel = 3;
+		    break;
+	    }
+	    cachedsi.wProcessorRevision = gCpuCaps.cpuStepping;
+    	    cachedsi.dwNumberOfProcessors = 1;	/* hardcoded */
 	}
-#endif
 
+/* disable cpuid based detection (mplayer's cpudetect.c does this - see above) */
+#if 0
 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__svr4__)
 	do_cpuid(1, regs);
 	switch ((regs[0] >> 8) & 0xf) {			// cpu family
@@ -908,7 +928,12 @@
 	if (regs[3] & (1 << 31))
 	  PF[PF_AMD3D_INSTRUCTIONS_AVAILABLE] = TRUE;
         cachedsi.dwNumberOfProcessors=1;
-#else
+#endif
+#endif /* if 0 */
+
+/* linux detection enabled (based on proc/cpuinfo) for checking
+   fdiv_bug and fpu emulation flags -- alex */
+#ifdef __linux__
 	{
 	char buf[20];
 	char line[200];
@@ -1037,7 +1062,8 @@
  */
         cachedsi.dwNumberOfProcessors=1;
 	}
-#endif /* __FreeBSD__ */
+#endif /* __linux__ */
+
 	cache = 1;
 	memcpy(si,&cachedsi,sizeof(*si));
 	DumpSystemInfo(si);




More information about the MPlayer-cvslog mailing list