Subject: MIPS64 syscall trace patch

From: Daniel Jacobowitz <[email-masked]>
Date: Thu, 4 Dec 2003 11:53:29 -0500

You need this do use PTRACE_SYSCALL on a 64-bit process.  Otherwise mmap()'s
last argument gets corrupted by syscall_trace().  Strace itself doesn't work
yet, but I'm making progress...

This is for 2.4.  2.6 patch will follow in a sec.

Index: arch/mips64/kernel/scall_64.S
===================================================================
RCS file: /home/cvs/linux/arch/mips64/kernel/Attic/scall_64.S,v
retrieving revision 1.20.2.18
diff -u -p -r1.20.2.18 scall_64.S
--- arch/mips64/kernel/scall_64.S	28 Oct 2003 13:39:37 -0000	1.20.2.18
+++ arch/mips64/kernel/scall_64.S	4 Dec 2003 16:51:01 -0000
@@ -108,6 +108,8 @@ trace_a_syscall:
 	ld	a1, PT_R5(sp)
 	ld	a2, PT_R6(sp)
 	ld	a3, PT_R7(sp)
+	ld	a4, PT_R8(sp)
+	ld	a5, PT_R9(sp)
 	jalr	t2
 
 	li	t0, -EMAXERRNO - 1	# error?
Index: arch/mips64/kernel/scall_n32.S
===================================================================
RCS file: /home/cvs/linux/arch/mips64/kernel/Attic/scall_n32.S,v
retrieving revision 1.2.2.14
diff -u -p -r1.2.2.14 scall_n32.S
--- arch/mips64/kernel/scall_n32.S	9 Oct 2003 15:42:33 -0000	1.2.2.14
+++ arch/mips64/kernel/scall_n32.S	4 Dec 2003 16:51:01 -0000
@@ -111,6 +111,8 @@ trace_a_syscall:
 	ld	a1, PT_R5(sp)
 	ld	a2, PT_R6(sp)
 	ld	a3, PT_R7(sp)
+	ld	a4, PT_R8(sp)
+	ld	a5, PT_R9(sp)
 	jalr	t2
 
 	li	t0, -EMAXERRNO - 1	# error?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer