summaryrefslogtreecommitdiff
path: root/Source/kwsys/SystemInformation.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-03-04 10:19:33 -0500
committerBrad King <brad.king@kitware.com>2014-03-04 10:19:33 -0500
commit7db95df39d8c191f3de92f4d60a0e4106700dda5 (patch)
tree2ad8cf29089fb986eb82a397e4ed87642a06c835 /Source/kwsys/SystemInformation.cxx
parent74b982ce734dd55a4155ba8ba0462fef894d6ec0 (diff)
parentf096786d5428505f8313f6b01f4631f5a34b27a2 (diff)
downloadcmake-7db95df39d8c191f3de92f4d60a0e4106700dda5.tar.gz
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys/SystemInformation.cxx')
-rw-r--r--Source/kwsys/SystemInformation.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 5f20853fb8..9c26380287 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -4698,11 +4698,28 @@ bool SystemInformationImplementation::QueryHaikuInfo()
{
#if defined(__HAIKU__)
+ // CPU count
system_info info;
get_system_info(&info);
-
this->NumberOfPhysicalCPU = info.cpu_count;
- this->CPUSpeedInMHz = info.cpu_clock_speed / 1000000.0F;
+
+ // CPU speed
+ uint32 topologyNodeCount = 0;
+ cpu_topology_node_info* topology = 0;
+ get_cpu_topology_info(0, &topologyNodeCount);
+ if (topologyNodeCount != 0)
+ topology = new cpu_topology_node_info[topologyNodeCount];
+ get_cpu_topology_info(topology, &topologyNodeCount);
+
+ for (uint32 i = 0; i < topologyNodeCount; i++) {
+ if (topology[i].type == B_TOPOLOGY_CORE) {
+ this->CPUSpeedInMHz = topology[i].data.core.default_frequency /
+ 1000000.0f;
+ break;
+ }
+ }
+
+ delete[] topology;
// Physical Memory
this->TotalPhysicalMemory = (info.max_pages * B_PAGE_SIZE) / (1024 * 1024) ;