From 4da9894dd519e0849ceb73ce21e86db966568949 Mon Sep 17 00:00:00 2001
From: Rolf Eike Beer <eike@sf-mail.de>
Date: Thu, 27 Dec 2012 15:33:40 +0100
Subject: [PATCH] SystemInformation: Clean up QuerySolarisInfo()

-do not always set NumberOfLogicalCPU to 1, it doesn't make any sense
 to have this number smaller than NumberOfPhysicalCPU. Instead keep
 both numbers the same and set LogicalProcessorsPerPhysical to 1.
-replace '/1024*8192/1024' with '/128'

Change-Id: Idf7d1983875040ceacae5547da408179ca10f1c3
---
 SystemInformation.cxx | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index bfdb0ed..39b97a0 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -4284,11 +4284,7 @@ bool SystemInformationImplementation::QuerySolarisInfo()
   this->NumberOfPhysicalCPU = static_cast<unsigned int>(
     atoi(this->ParseValueFromKStat("-n syste_misc -s ncpus").c_str()));
   this->NumberOfLogicalCPU = this->NumberOfPhysicalCPU;
-
-  if(this->NumberOfPhysicalCPU!=0)
-    {
-    this->NumberOfLogicalCPU /= this->NumberOfPhysicalCPU;
-    }
+  this->Features.ExtendedFeatures.LogicalProcessorsPerPhysical = 1;
 
   this->CPUSpeedInMHz = static_cast<float>(atoi(this->ParseValueFromKStat("-s clock_MHz").c_str()));
 
@@ -4310,9 +4306,7 @@ bool SystemInformationImplementation::QuerySolarisInfo()
   char* tail;
   unsigned long totalMemory =
        strtoul(this->ParseValueFromKStat("-s physmem").c_str(),&tail,0);
-  this->TotalPhysicalMemory = totalMemory/1024;
-  this->TotalPhysicalMemory *= 8192;
-  this->TotalPhysicalMemory /= 1024;
+  this->TotalPhysicalMemory = totalMemory/128;
 
   // Undefined values (for now at least)
   this->TotalVirtualMemory = 0;
-- 
GitLab