diff options
author | Brad King <brad.king@kitware.com> | 2013-12-19 15:44:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-12-19 15:44:29 (GMT) |
commit | 2a943d9264c995f3d2c55b3da202b88f67329750 (patch) | |
tree | 16a35312f8ad76d32c33492ce3ca53a353477400 /Source/kwsys/SystemInformation.cxx | |
parent | b375c18b9ea256e2e9a05fd8465c6d90b86b6f5b (diff) | |
parent | f788d9a1b27efc9b463b1174a93e780bef00a5d9 (diff) | |
download | CMake-2a943d9264c995f3d2c55b3da202b88f67329750.zip CMake-2a943d9264c995f3d2c55b3da202b88f67329750.tar.gz CMake-2a943d9264c995f3d2c55b3da202b88f67329750.tar.bz2 |
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys/SystemInformation.cxx')
-rw-r--r-- | Source/kwsys/SystemInformation.cxx | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 2f6c949..5f20853 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -3162,8 +3162,17 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile() kwsys_stl::string cores = this->ExtractValueFromCpuInfoFile(buffer,"cpu cores"); int numberOfCoresPerCPU=atoi(cores.c_str()); - this->NumberOfPhysicalCPU=static_cast<unsigned int>( - numberOfCoresPerCPU*(maxId+1)); + if (maxId > 0) + { + this->NumberOfPhysicalCPU=static_cast<unsigned int>( + numberOfCoresPerCPU*(maxId+1)); + } + else + { + // Linux Sparc: get cpu count + this->NumberOfPhysicalCPU= + atoi(this->ExtractValueFromCpuInfoFile(buffer,"ncpus active").c_str()); + } #else // __CYGWIN__ // does not have "physical id" entries, neither "cpu cores" @@ -3185,7 +3194,19 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile() // CPU speed (checking only the first processor) kwsys_stl::string CPUSpeed = this->ExtractValueFromCpuInfoFile(buffer,"cpu MHz"); - this->CPUSpeedInMHz = static_cast<float>(atof(CPUSpeed.c_str())); + if(!CPUSpeed.empty()) + { + this->CPUSpeedInMHz = static_cast<float>(atof(CPUSpeed.c_str())); + } +#ifdef __linux + else + { + // Linux Sparc: CPU speed is in Hz and encoded in hexadecimal + CPUSpeed = this->ExtractValueFromCpuInfoFile(buffer,"Cpu0ClkTck"); + this->CPUSpeedInMHz = static_cast<float>( + strtoull(CPUSpeed.c_str(),0,16))/1000000.0f; + } +#endif // Chip family kwsys_stl::string familyStr = @@ -4991,7 +5012,12 @@ bool SystemInformationImplementation::QueryHPUXProcessor() case CPU_PA_RISC2_0: this->ChipID.Vendor = "Hewlett-Packard"; this->ChipID.Family = 0x200; +# ifdef CPU_HP_INTEL_EM_1_0 + case CPU_HP_INTEL_EM_1_0: +# endif +# ifdef CPU_IA64_ARCHREV_0 case CPU_IA64_ARCHREV_0: +# endif this->ChipID.Vendor = "GenuineIntel"; this->Features.HasIA64 = true; break; |