From: Petar Jovanovic Date: Wed, 3 Apr 2019 17:38:08 +0000 (+0000) Subject: mips32: pass correct syscall value to kernel in case of __NR_syscall X-Git-Tag: VALGRIND_3_15_0~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37f09ed248387ed3f4c7ba712fbc90e7468f6f4d;p=thirdparty%2Fvalgrind.git mips32: pass correct syscall value to kernel in case of __NR_syscall The syscall number has to be put in register v0 before call into the kernel. This was omitted when system call is __NR_syscall (and when the syscall argument is the system call number of interest). Patch by Nikola Milutinovic. --- diff --git a/coregrind/m_syswrap/syscall-mips32-linux.S b/coregrind/m_syswrap/syscall-mips32-linux.S index 0bbfb2b5cd..51f6518ebc 100644 --- a/coregrind/m_syswrap/syscall-mips32-linux.S +++ b/coregrind/m_syswrap/syscall-mips32-linux.S @@ -112,7 +112,7 @@ ML_(do_syscall_for_client_WRK): lw $8, 48($29) /* t0 == ThreadState */ - lw $2, 52($29) /* v0 == syscallno */ + lw $2, OFFSET_mips32_r2($8) /* v0 == guest_v0 */ lw $4, OFFSET_mips32_r4($8) lw $5, OFFSET_mips32_r5($8) lw $6, OFFSET_mips32_r6($8)