This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, master has been updated via 99ddf6a12d54854ae4f27eecd592fef5cb22640f (commit) via 1c2a9b8140829ba886d67bca084ee40eb0a20b84 (commit) from 00c88bbcd84b43ef7ac8e08cbb858f5943a2657a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=99ddf6a12d54854ae4f27eecd592fef5cb22640f commit 99ddf6a12d54854ae4f27eecd592fef5cb22640f Author: David Cole <david.c...@kitware.com> AuthorDate: Wed Jan 5 15:38:52 2011 -0500 Commit: David Cole <david.c...@kitware.com> CommitDate: Wed Jan 5 15:40:03 2011 -0500 KWSys: Retrieve QNX specific memory and processor info (#11329) Author: Rolf Eike Beer <e...@sf-mail.de> 2010-10-18 12:03:39 diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 6356123..9bc659e 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -264,6 +264,10 @@ protected: //For Haiku OS bool QueryHaikuInfo(); + //For QNX + bool QueryQNXMemory(); + bool QueryQNXProcessor(); + // Evaluate the memory information. int QueryMemory(); size_t TotalVirtualMemory; @@ -597,6 +601,8 @@ void SystemInformationImplementation::RunCPUCheck() this->QuerySolarisInfo(); #elif defined(__HAIKU__) this->QueryHaikuInfo(); +#elif defined(__QNX__) + this->QueryQNXProcessor(); #else this->RetreiveInformationFromCpuInfoFile(); #endif @@ -615,6 +621,8 @@ void SystemInformationImplementation::RunMemoryCheck() this->QuerySolarisInfo(); #elif defined(__HAIKU__) this->QueryHaikuInfo(); +#elif defined(__QNX__) + this->QueryQNXMemory(); #else this->QueryMemory(); #endif @@ -3264,6 +3272,89 @@ bool SystemInformationImplementation::QueryHaikuInfo() #endif } +bool SystemInformationImplementation::QueryQNXMemory() +{ +#if defined(__QNX__) + kwsys_stl::string buffer; + kwsys_stl::vector<const char*> args; + args.clear(); + + args.push_back("showmem"); + args.push_back("-S"); + args.push_back(0); + buffer = this->RunProcess(args); + args.clear(); + + size_t pos = buffer.find("System RAM:"); + if (pos == buffer.npos) + return false; + pos = buffer.find(":", pos); + size_t pos2 = buffer.find("M (", pos); + if (pos2 == buffer.npos) + return false; + + pos++; + while (buffer[pos] == ' ') + pos++; + + this->TotalPhysicalMemory = atoi(buffer.substr(pos, pos2 - pos).c_str()); + return true; +#endif + return false; +} + +bool SystemInformationImplementation::QueryQNXProcessor() +{ +#if defined(__QNX__) + // the output on my QNX 6.4.1 looks like this: + // Processor1: 686 Pentium II Stepping 3 2175MHz FPU + kwsys_stl::string buffer; + kwsys_stl::vector<const char*> args; + args.clear(); + + args.push_back("pidin"); + args.push_back("info"); + args.push_back(0); + buffer = this->RunProcess(args); + args.clear(); + + size_t pos = buffer.find("Processor1:"); + if (pos == buffer.npos) + return false; + + size_t pos2 = buffer.find("MHz", pos); + if (pos2 == buffer.npos) + return false; + + size_t pos3 = pos2; + while (buffer[pos3] != ' ') + --pos3; + + this->CPUSpeedInMHz = atoi(buffer.substr(pos3 + 1, pos2 - pos3 - 1).c_str()); + + pos2 = buffer.find(" Stepping", pos); + if (pos2 != buffer.npos) + { + pos2 = buffer.find(" ", pos2 + 1); + if (pos2 != buffer.npos && pos2 < pos3) + { + this->ChipID.Revision = atoi(buffer.substr(pos2 + 1, pos3 - pos2).c_str()); + } + } + + this->NumberOfPhysicalCPU = 0; + do + { + pos = buffer.find("\nProcessor", pos + 1); + ++this->NumberOfPhysicalCPU; + } while (pos != buffer.npos); + this->NumberOfLogicalCPU = 1; + + return true; +#else + return false; +#endif +} /** Query the operating system information */ bool SystemInformationImplementation::QueryOSInformation() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c2a9b8140829ba886d67bca084ee40eb0a20b84 commit 1c2a9b8140829ba886d67bca084ee40eb0a20b84 Author: David Cole <david.c...@kitware.com> AuthorDate: Wed Jan 5 15:35:35 2011 -0500 Commit: David Cole <david.c...@kitware.com> CommitDate: Wed Jan 5 15:40:02 2011 -0500 KWSys: Fix CPU speed calculations (#9963) To get from Hz to MHz the factor is 10^6, not 2^20. Author: Rolf Eike Beer <e...@sf-mail.de> 2010-10-24 06:31:11 diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index f871075..6356123 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -1548,17 +1548,17 @@ bool SystemInformationImplementation::RetrieveClassicalCPUClockSpeed() if (this->ChipID.Family == 3) { // 80386 processors.... Loop time is 115 cycles! - dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 115) / dDifference) / 1048576); + dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 115) / dDifference) / 1000000); } else if (this->ChipID.Family == 4) { // 80486 processors.... Loop time is 47 cycles! - dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 47) / dDifference) / 1048576); + dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 47) / dDifference) / 1000000); } else if (this->ChipID.Family == 5) { // Pentium processors.... Loop time is 43 cycles! - dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 43) / dDifference) / 1048576); + dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 43) / dDifference) / 1000000); } // Save the clock speed. @@ -2934,7 +2934,7 @@ bool SystemInformationImplementation::ParseSysCtl() len = sizeof(value); sysctlbyname("hw.cpufrequency", &value, &len, NULL, 0); - this->CPUSpeedInMHz = static_cast< float >( value )/ 1048576; + this->CPUSpeedInMHz = static_cast< float >( value )/ 1000000; // Chip family ----------------------------------------------------------------------- Summary of changes: Source/kwsys/SystemInformation.cxx | 99 ++++++++++++++++++++++++++++++++++-- 1 files changed, 95 insertions(+), 4 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits