Commit b1916e0a authored by Adrien Destugues's avatar Adrien Destugues Committed by Brad King

SystemInformation: Update CPU count code for Haiku

The Haiku API for this was recently changed, to allow more than 8 CPU
cores.

Change-Id: Ia5e0d733cdfabaeffdb7707045f6635734ddac2e
parent e66d99b8
......@@ -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) ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment