|
From: <sv...@va...> - 2013-10-31 16:58:43
|
Author: dejanj
Date: Thu Oct 31 16:58:31 2013
New Revision: 13707
Log:
mips32/64: Fix the problem with cacheflush on mips platforms.
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.
Modified:
trunk/coregrind/m_syswrap/syswrap-mips32-linux.c
trunk/coregrind/m_syswrap/syswrap-mips64-linux.c
Modified: trunk/coregrind/m_syswrap/syswrap-mips32-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-mips32-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-mips32-linux.c Thu Oct 31 16:58:31 2013
@@ -764,11 +764,11 @@
/* 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 @@
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
Modified: trunk/coregrind/m_syswrap/syswrap-mips64-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-mips64-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-mips64-linux.c Thu Oct 31 16:58:31 2013
@@ -398,11 +398,11 @@
/* 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);
}
|