]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips32/mips64: rename mips32_features to mips_features
authorPetar Jovanovic <mips32r2@gmail.com>
Sun, 15 Sep 2013 22:49:01 +0000 (22:49 +0000)
committerPetar Jovanovic <mips32r2@gmail.com>
Sun, 15 Sep 2013 22:49:01 +0000 (22:49 +0000)
As this file is now detecting mips64/Cavium boards, we are renaming it to
reflect that. The functional change is that mips_features now can detect
Cavium board and allow Cavium-specific tests to be run.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13551

none/tests/mips32/mips32_dsp.vgtest
none/tests/mips32/mips32_dspr2.vgtest
tests/Makefile.am
tests/mips_features.c [moved from tests/mips32_features.c with 79% similarity]

index a5f3d07c03b2f297b7a3240970466eaa02a2497c..260e704d6b69268ac68b5a6f5d3cf8ec373e4f1b 100644 (file)
@@ -1,3 +1,3 @@
 prog: mips32_dsp
-prereq: ../../../tests/mips32_features mips32-dsp
+prereq: ../../../tests/mips_features mips32-dsp
 vgopts: -q
index 1ebc39b9cd3b87021386ccc65c1157a7962e2000..2dd90b413daa3858b330b539c6ad898e18756f62 100644 (file)
@@ -1,3 +1,3 @@
 prog: mips32_dspr2
-prereq: ../../../tests/mips32_features mips32-dspr2
+prereq: ../../../tests/mips_features mips32-dspr2
 vgopts: -q
index 249111cd62131ad1b5082e2a75399169be55eff2..0303a617590041100580becb6c8b14d1011dd97b 100644 (file)
@@ -26,7 +26,7 @@ check_PROGRAMS = \
        true \
        x86_amd64_features \
        s390x_features \
-       mips32_features
+       mips_features
 
 AM_CFLAGS   += $(AM_FLAG_M3264_PRI)
 AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
similarity index 79%
rename from tests/mips32_features.c
rename to tests/mips_features.c
index 191f2601de7958dee72300edabe1d6b8c94c7d87..559cd69974a5992dc08c727978b35d4d530e45cf 100644 (file)
@@ -1,10 +1,10 @@
-// This file determines MIPS32 features a processor supports.
+// This file determines MIPS features a processor supports.
 //
 // We return:
 // - 0 if the machine matches the asked-for feature.
 // - 1 if the machine does not.
 // - 2 if the asked-for feature isn't recognised (this will be the case for
-//     any feature if run on a non-MIPS32 machine).
+//     any feature if run on a non-MIPS machine).
 // - 3 if there was a usage error (it also prints an error message).
 #include <stdio.h>
 #include <stdlib.h>
@@ -16,7 +16,7 @@
 #define UNRECOGNISED_FEATURE  2
 #define USAGE_ERROR           3
 
-#if defined(VGA_mips32)
+#if defined(VGA_mips32) || defined(VGA_mips64)
 static int mipsCPUInfo(const char *search_string) {
    const char *file_name = "/proc/cpuinfo";
    /* Simple detection of MIPS DSP ASE at runtime for Linux.
@@ -63,6 +63,14 @@ static int go(char *feature)
       } else{
          return FEATURE_NOT_PRESENT;
       }
+   } else if ((strcmp(feature, "cavium-octeon") == 0)) {
+      const char *cavium = "Cavium Octeon";
+      cpuinfo = mipsCPUInfo(cavium);
+      if (cpuinfo == 1) {
+         return FEATURE_PRESENT;
+      } else{
+         return FEATURE_NOT_PRESENT;
+      }
    } else {
       return UNRECOGNISED_FEATURE;
    }
@@ -73,7 +81,7 @@ static int go(char *feature)
 
 static int go(char *feature)
 {
-   /* Feature is not recognised. (non-MIPS32 machine!) */
+   /* Feature is not recognised. (non-MIPS machine!) */
    return UNRECOGNISED_FEATURE;
 }
 
@@ -86,7 +94,7 @@ static int go(char *feature)
 int main(int argc, char **argv)
 {
    if (argc != 2) {
-      fprintf( stderr, "usage: mips32_features <feature>\n" );
+      fprintf( stderr, "usage: mips_features <feature>\n" );
       exit(USAGE_ERROR);
    }
    return go(argv[1]);