]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips32: pass correct syscall value to kernel in case of __NR_syscall
authorPetar Jovanovic <mips32r2@gmail.com>
Wed, 3 Apr 2019 17:38:08 +0000 (17:38 +0000)
committerPetar Jovanovic <mips32r2@gmail.com>
Wed, 3 Apr 2019 17:40:08 +0000 (17:40 +0000)
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.

coregrind/m_syswrap/syscall-mips32-linux.S

index 0bbfb2b5cd564449b54f174c8ee16f0caf4c8de8..51f6518ebc935fbd9cef73f5dec495d621c85a9e 100644 (file)
@@ -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)