diff options
author | Brad King <brad.king@kitware.com> | 2014-03-04 10:19:33 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-04 10:19:33 -0500 |
commit | 7db95df39d8c191f3de92f4d60a0e4106700dda5 (patch) | |
tree | 2ad8cf29089fb986eb82a397e4ed87642a06c835 /Source/kwsys/SystemInformation.cxx | |
parent | 74b982ce734dd55a4155ba8ba0462fef894d6ec0 (diff) | |
parent | f096786d5428505f8313f6b01f4631f5a34b27a2 (diff) | |
download | cmake-7db95df39d8c191f3de92f4d60a0e4106700dda5.tar.gz |
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys/SystemInformation.cxx')
-rw-r--r-- | Source/kwsys/SystemInformation.cxx | 21 |
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) ; |