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

Contents of /trunk/common/src/x86emitter/LnxCpuDetect.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10 - (show annotations) (download)
Mon Sep 6 11:40:06 2010 UTC (9 years, 5 months ago) by william
File size: 1958 byte(s)
exported r3113 from ./upstream/trunk
1 /* Cpudetection lib
2 * Copyright (C) 2002-2010 PCSX2 Dev Team
3 *
4 * PCSX2 is free software: you can redistribute it and/or modify it under the terms
5 * of the GNU Lesser General Public License as published by the Free Software Found-
6 * ation, either version 3 of the License, or (at your option) any later version.
7 *
8 * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 * PURPOSE. See the GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License along with PCSX2.
13 * If not, see <http://www.gnu.org/licenses/>.
14 */
15
16
17 #include "PrecompiledHeader.h"
18 #include "cpudetect_internal.h"
19
20 // Note: Apparently this solution is Linux/Solaris only.
21 // FreeBSD/OsX need something far more complicated (apparently)
22 void CountLogicalCores( int LogicalCoresPerPhysicalCPU, int PhysicalCoresPerPhysicalCPU )
23 {
24 const uint numCPU = sysconf( _SC_NPROCESSORS_ONLN );
25 if( numCPU > 0 )
26 {
27 //isMultiCore = numCPU > 1;
28 x86caps.LogicalCores = numCPU;
29 x86caps.PhysicalCores = ( numCPU / LogicalCoresPerPhysicalCPU ) * PhysicalCoresPerPhysicalCPU;
30 }
31 else
32 {
33 // Indeterminate?
34 x86caps.LogicalCores = 1;
35 x86caps.PhysicalCores = 1;
36 }
37 }
38
39 bool CanEmitShit()
40 {
41 // In Linux I'm pretty sure TLS always works, none of the funny business that Windows
42 // has involving DLLs. >_<
43 return true;
44 }
45
46 bool CanTestInstructionSets()
47 {
48 // Not implemented yet for linux. (see cpudetect_internal.h for details)
49 return false;
50 }
51
52 bool _test_instruction( void* pfnCall )
53 {
54 // Not implemented yet for linux. (see cpudetect_internal.h for details)
55 return false;
56 }
57
58 // Not implemented yet for linux (see cpudetect_internal.h for details)
59 SingleCoreAffinity::SingleCoreAffinity() {}
60 SingleCoreAffinity::~SingleCoreAffinity() throw() {}

  ViewVC Help
Powered by ViewVC 1.1.22