]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips32/64: Fix the problem with cacheflush on mips platforms.
authorDejan Jevtic <dejan.jevtic@valgrind.org>
Thu, 31 Oct 2013 16:58:31 +0000 (16:58 +0000)
committerDejan Jevtic <dejan.jevtic@valgrind.org>
Thu, 31 Oct 2013 16:58:31 +0000 (16:58 +0000)
On mips platforms the second cacheflush parameter is the number
of bytes in cache that needs to be flushed. When we are discarding
translation we need to use this number instead of:
((ULong) ARG2) - ((ULong) ARG1) + 1ULL
This patch also include syscall wrapper for __NR_sigaction on mips32.

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

coregrind/m_syswrap/syswrap-mips32-linux.c
coregrind/m_syswrap/syswrap-mips64-linux.c

index 40de789ce57b00673041ba0a283a4afed0058712..4ca60112e069c2073c41d48c2fd7f0bf6ea774c1 100644 (file)
@@ -764,11 +764,11 @@ PRE (sys_set_thread_area)
 /* Very much MIPS specific */
 PRE (sys_cacheflush)
 {
-  PRINT ("cacheflush (%lx, %#lx, %#lx)", ARG1, ARG2, ARG3);
-  PRE_REG_READ3 (long, "cacheflush", void *, addrlow, void *, addrhigh, int,
-                 flags);
-  VG_ (discard_translations) ((Addr64) ARG1, ((ULong) ARG2) - ((ULong) ARG1) +
-                              1ULL /*paranoia */ , "PRE(sys_cacheflush)");
+  PRINT ("cacheflush (%lx, %lx, %lx)", ARG1, ARG2, ARG3);
+  PRE_REG_READ3(long, "cacheflush", unsigned long, addr,
+                int, nbytes, int, cache);
+  VG_ (discard_translations) ((Addr64) ARG1, ((ULong) ARG2),
+                              "PRE(sys_cacheflush)");
   SET_STATUS_Success (0);
 }
 
@@ -884,7 +884,7 @@ static SyscallTableEntry syscall_main_table[] = {
    GENX_ (__NR_getppid,                sys_getppid),                 // 64
    GENX_ (__NR_getpgrp,                sys_getpgrp),                 // 65
    GENX_ (__NR_setsid,                 sys_setsid),                  // 66
-   //   PLAXY(__NR_sigaction,         sys_sigaction),         // 67
+   LINXY (__NR_sigaction,              sys_sigaction),               // 67
    //..    //   (__NR_sgetmask,          sys_sgetmask),          // 68
    //..    //   (__NR_ssetmask,          sys_ssetmask),          // 69
    GENX_ (__NR_setreuid,               sys_setreuid),                // 70
index 9452f516abc4c35e415effed6b8951618e7720ef..bab3aaa72f0578bd7fe6f8edc1685aed1c898c16 100644 (file)
@@ -398,11 +398,11 @@ PRE(sys_sysfs)
 /* Very much MIPS specific */
 PRE(sys_cacheflush)
 {
-   PRINT("cacheflush (%lx, %#lx, %#lx)", ARG1, ARG2, ARG3);
-   PRE_REG_READ3(long, "cacheflush", void *, addrlow, void *, addrhigh,
-                 int, flags);
-   VG_(discard_translations)((Addr64) ARG1, ((ULong) ARG2) - ((ULong) ARG1) +
-                             1ULL /*paranoia */ , "PRE(sys_cacheflush)");
+   PRINT("cacheflush (%lx, %lx, %lx)", ARG1, ARG2, ARG3);
+   PRE_REG_READ3(long, "cacheflush", unsigned long, addr,
+                 int, nbytes, int, cache);
+   VG_ (discard_translations) ((Addr64) ARG1, ((ULong) ARG2),
+                               "PRE(sys_cacheflush)");
    SET_STATUS_Success(0);
 }