From: Petar Jovanovic Date: Wed, 29 Jan 2014 15:58:09 +0000 (+0000) Subject: mips64: detect Cavium Octeon II in mips_features X-Git-Tag: svn/VALGRIND_3_10_0~654 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09034f1ee241cbcfbda7be9eee3e3ee7ca58e97c;p=thirdparty%2Fvalgrind.git mips64: detect Cavium Octeon II in mips_features Detect Cavium Octeon II CPU. This is needed as a prerequisite for successful execution of cavium-octeon2 specific tests. Patch by Zahid Anwar. Related to Bugzilla issue 326444. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13782 --- diff --git a/tests/mips_features.c b/tests/mips_features.c index 559cd69974..df6996c9cf 100644 --- a/tests/mips_features.c +++ b/tests/mips_features.c @@ -47,7 +47,7 @@ static int mipsCPUInfo(const char *search_string) { static int go(char *feature) { int cpuinfo; - if ( (strcmp(feature, "mips32-dsp") == 0)) { + if (strcmp(feature, "mips32-dsp") == 0) { const char *dsp = "dsp"; cpuinfo = mipsCPUInfo(dsp); if (cpuinfo == 1) { @@ -55,7 +55,7 @@ static int go(char *feature) } else{ return FEATURE_NOT_PRESENT; } - } else if ((strcmp(feature, "mips32-dspr2") == 0)) { + } else if (strcmp(feature, "mips32-dspr2") == 0) { const char *dsp2 = "dsp2"; cpuinfo = mipsCPUInfo(dsp2); if (cpuinfo == 1) { @@ -63,7 +63,7 @@ static int go(char *feature) } else{ return FEATURE_NOT_PRESENT; } - } else if ((strcmp(feature, "cavium-octeon") == 0)) { + } else if (strcmp(feature, "cavium-octeon") == 0) { const char *cavium = "Cavium Octeon"; cpuinfo = mipsCPUInfo(cavium); if (cpuinfo == 1) { @@ -71,6 +71,14 @@ static int go(char *feature) } else{ return FEATURE_NOT_PRESENT; } + } else if (strcmp(feature, "cavium-octeon2") == 0) { + const char *cavium2 = "Cavium Octeon II"; + cpuinfo = mipsCPUInfo(cavium2); + if (cpuinfo == 1) { + return FEATURE_PRESENT; + } else{ + return FEATURE_NOT_PRESENT; + } } else { return UNRECOGNISED_FEATURE; }