From d0de3776bd1d947cc679e2570328289c3f4b5750 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 27 Dec 2012 21:16:39 -0800 Subject: [PATCH] - client: processor identification for ARM (from Evandro Menezes and Joachim Fritzsch) --- checkin_notes | 8 ++++++++ client/hostinfo_unix.cpp | 7 +++++++ client/hostinfo_unix_test.cpp | 36 ++++++++++++++++++++++------------- doc/projects.inc | 4 ++-- doc/projects.php | 1 - 5 files changed, 40 insertions(+), 16 deletions(-) diff --git a/checkin_notes b/checkin_notes index b5bf23b119..f2eb08c834 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7920,3 +7920,11 @@ David 26 Dec 2012 str_util.cpp sched/ hr_info.cpp + +David 27 Dec 2012 + - client: processor identification for ARM + (from Evandro Menezes and Joachim Fritzsch) + + client/ + hostinfo_unix.cpp + hostinfo_unix_test.cpp diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index e89a7f1083..fcfe9f515f 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -466,6 +466,9 @@ static void parse_cpuinfo_linux(HOST_INFO& host) { #elif __ia64__ strcpy(host.p_model, "IA-64 "); model_hack = true; +#elif __arm__ + strcpy(host.p_vendor, "ARM"); + vendor_hack = vendor_found = true; #endif host.m_cache=-1; @@ -504,6 +507,8 @@ static void parse_cpuinfo_linux(HOST_INFO& host) { strstr(buf, "family : ") || strstr(buf, "model name : ") #elif __powerpc__ || __sparc__ strstr(buf, "cpu\t\t: ") +#elif __arm__ + strstr(buf, "Processor\t: ") #else strstr(buf, "model name\t: ") || strstr(buf, "cpu model\t\t: ") #endif @@ -589,6 +594,8 @@ static void parse_cpuinfo_linux(HOST_INFO& host) { strlcpy(features, strchr(buf, ':') + 2, sizeof(features)); } else if ((strstr(buf, "features : ") == buf)) { /* ia64 */ strlcpy(features, strchr(buf, ':') + 2, sizeof(features)); + } else if ((strstr(buf, "Features\t: ") == buf)) { /* arm */ + strlcpy(features, strchr(buf, ':') + 2, sizeof(features)); } if (strlen(features)) { features_found = true; diff --git a/client/hostinfo_unix_test.cpp b/client/hostinfo_unix_test.cpp index 76ae87238d..ca010682a8 100644 --- a/client/hostinfo_unix_test.cpp +++ b/client/hostinfo_unix_test.cpp @@ -15,8 +15,10 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . -#include -#include +#include +#include +#include +#include #define false 0 #define true 1 @@ -37,7 +39,7 @@ int main(void) { FILE* f = fopen("/proc/cpuinfo", "r"); - if (!f) return; + if (!f) return (EXIT_FAILURE); #ifdef __mips__ strcpy(p_model, "MIPS "); @@ -51,6 +53,9 @@ int main(void) { #elif __ia64__ strcpy(p_model, "IA-64 "); model_hack = true; +#elif __arm__ + strcpy(p_vendor, "ARM "); + vendor_hack = vendor_found = true; #endif strcpy(features, ""); @@ -68,29 +73,33 @@ int main(void) { strstr(buf, "type\t\t: ") #elif __alpha__ strstr(buf, "cpu\t\t\t: ") +#elif __arm__ + strstr(buf, "CPU architecture: ") #else - strstr(buf, "vendor_id\t: ") || strstr(buf, "system type\t\t: ") + strstr(buf, "vendor_id\t: ") || strstr(buf, "system type\t\t: ") #endif ) { if (!vendor_hack && !vendor_found) { vendor_found = true; strlcpy(p_vendor, strchr(buf, ':') + 2, sizeof(p_vendor)); } else if (!vendor_found) { - vendor_found = true; - strlcpy(buf2, strchr(buf, ':') + 2, sizeof(p_vendor) - strlen(p_vendor) - 1); - strcat(p_vendor, buf2); - } + vendor_found = true; + strlcpy(buf2, strchr(buf, ':') + 2, sizeof(p_vendor) - strlen(p_vendor) - 1); + strcat(p_vendor, buf2); + } } if ( #ifdef __ia64__ - strstr(buf, "family : ") || strstr(buf, "model name : ") + strstr(buf, "family : ") || strstr(buf, "model name : ") #elif __powerpc__ || __sparc__ - strstr(buf, "cpu\t\t: ") + strstr(buf, "cpu\t\t: ") +#elif __arm__ + strstr(buf, "Processor\t: ") #else - strstr(buf, "model name\t: ") || strstr(buf, "cpu model\t\t: ") + strstr(buf, "model name\t: ") || strstr(buf, "cpu model\t\t: ") #endif - ) { + ) { if (!model_hack && !model_found) { model_found = true; #ifdef __powerpc__ @@ -170,6 +179,8 @@ int main(void) { strlcpy(features, strchr(buf, ':') + 2, sizeof(features)); } else if ((strstr(buf, "features : ") == buf)) { /* ia64 */ strlcpy(features, strchr(buf, ':') + 2, sizeof(features)); + } else if ((strstr(buf, "Features\t: ") == buf)) { /* arm */ + strlcpy(features, strchr(buf, ':') + 2, sizeof(features)); } if (strlen(features)) { features_found = true; @@ -204,5 +215,4 @@ int main(void) { p_vendor, m_cache, model_buf ); fclose(f); - return 0; } diff --git a/doc/projects.inc b/doc/projects.inc index d6dd3b6426..da0c6fbfc0 100644 --- a/doc/projects.inc +++ b/doc/projects.inc @@ -177,12 +177,12 @@ $earth = array( ), ); $astro_phys_chem = array( - tra("Astronomy/Physics/Chemistry"), + tra("Astronomy, Physics, and Chemistry"), array( array( "Constellation", "http://aerospaceresearch.net/constellation/", - "Rechenkraft.net, DGLR, Selfnet, and shack", + "Rechenkraft.net, DGLR, Selfnet, and shack", "Aerospace-related science and engineering", "Constellation is a platform for aerospace-related simulations, including trajectory optimization of launchers, satellites and probes, simulation of Moon's near-surface exosphere, and analysis of dynamic systems of exploration-rovers", "constellation2.png" diff --git a/doc/projects.php b/doc/projects.php index 4c34bbb6bf..0cc729561c 100644 --- a/doc/projects.php +++ b/doc/projects.php @@ -107,7 +107,6 @@ function ordered_display($areas, $sort) { $projects = null; foreach ($areas as $area) { $title = $area[0]; - if (sizeof($area)==3) $title .= $area[2]; $projs = $area[1]; foreach ($projs as $p) { $p['area'] = $title;