mirror of
https://github.com/mpv-player/mpv
synced 2025-01-20 21:07:29 +01:00
updated cpudetection
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3405 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
676d9cfebd
commit
55a015e6cf
@ -864,7 +864,6 @@ void WINAPI expGetSystemInfo(SYSTEM_INFO* si)
|
||||
cachedsi.wProcessorLevel = 5; /* pentium */
|
||||
cachedsi.wProcessorRevision = 0x0101;
|
||||
|
||||
#if 1
|
||||
/* mplayer's way to detect PF's */
|
||||
{
|
||||
#include "../cpudetect.h"
|
||||
@ -876,9 +875,30 @@ void WINAPI expGetSystemInfo(SYSTEM_INFO* si)
|
||||
PF[PF_XMMI_INSTRUCTIONS_AVAILABLE] = TRUE;
|
||||
if (gCpuCaps.has3DNow)
|
||||
PF[PF_AMD3D_INSTRUCTIONS_AVAILABLE] = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
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 */
|
||||
}
|
||||
|
||||
/* 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 @@ void WINAPI expGetSystemInfo(SYSTEM_INFO* si)
|
||||
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 @@ void WINAPI expGetSystemInfo(SYSTEM_INFO* si)
|
||||
*/
|
||||
cachedsi.dwNumberOfProcessors=1;
|
||||
}
|
||||
#endif /* __FreeBSD__ */
|
||||
#endif /* __linux__ */
|
||||
|
||||
cache = 1;
|
||||
memcpy(si,&cachedsi,sizeof(*si));
|
||||
DumpSystemInfo(si);
|
||||
|
Loading…
Reference in New Issue
Block a user