]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips64: detect Cavium Octeon II in mips_features
authorPetar Jovanovic <mips32r2@gmail.com>
Wed, 29 Jan 2014 15:58:09 +0000 (15:58 +0000)
committerPetar Jovanovic <mips32r2@gmail.com>
Wed, 29 Jan 2014 15:58:09 +0000 (15:58 +0000)
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

tests/mips_features.c

index 559cd69974a5992dc08c727978b35d4d530e45cf..df6996c9cfadcbd1dad14a4ce5e69a75ddbff8a8 100644 (file)
@@ -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;
    }