/[pcsx2_0.9.7]/trunk/common/src/x86emitter/WinCpuDetect.cpp
ViewVC logotype

Diff of /trunk/common/src/x86emitter/WinCpuDetect.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 31 by william, Tue Sep 7 03:24:11 2010 UTC revision 62 by william, Tue Sep 7 11:08:22 2010 UTC
# Line 17  Line 17 
17  #include "PrecompiledHeader.h"  #include "PrecompiledHeader.h"
18  #include "cpudetect_internal.h"  #include "cpudetect_internal.h"
19    
20  void CountLogicalCores( int LogicalCoresPerPhysicalCPU, int PhysicalCoresPerPhysicalCPU )  void x86capabilities::CountLogicalCores()
21  {  {
22          DWORD vProcessCPUs;          DWORD vProcessCPUs;
23          DWORD vSystemCPUs;          DWORD vSystemCPUs;
24    
25          x86caps.LogicalCores = 1;          LogicalCores = 1;
26    
27          if( !GetProcessAffinityMask (GetCurrentProcess (),          if( !GetProcessAffinityMask (GetCurrentProcess (),
28                  &vProcessCPUs, &vSystemCPUs) ) return;                  &vProcessCPUs, &vSystemCPUs) ) return;
29    
30          int CPUs = 0;          uint CPUs = 0;
31          DWORD bit;          DWORD bit;
32    
33          for (bit = 1; bit != 0; bit <<= 1)          for (bit = 1; bit != 0; bit <<= 1)
# Line 36  void CountLogicalCores( int LogicalCores Line 36  void CountLogicalCores( int LogicalCores
36                          CPUs++;                          CPUs++;
37          }          }
38    
39          x86caps.LogicalCores = CPUs;          LogicalCores = CPUs;
40          if( LogicalCoresPerPhysicalCPU > CPUs) // for 1-socket HTT-disabled machines          if( LogicalCoresPerPhysicalCPU > CPUs) // for 1-socket HTT-disabled machines
41                  LogicalCoresPerPhysicalCPU = CPUs;                  LogicalCoresPerPhysicalCPU = CPUs;
42    
43          x86caps.PhysicalCores = ( CPUs / LogicalCoresPerPhysicalCPU ) * PhysicalCoresPerPhysicalCPU;          PhysicalCores = ( CPUs / LogicalCoresPerPhysicalCPU ) * PhysicalCoresPerPhysicalCPU;
44  }  }
45    
46  bool _test_instruction( void* pfnCall )  bool _test_instruction( void* pfnCall )

Legend:
Removed from v.31  
changed lines
  Added in v.62

  ViewVC Help
Powered by ViewVC 1.1.22