[parisc-linux-cvs] preserve syscall number in r20 over fork()

Richard Hirst rhirst@linuxcare.com
Mon, 19 Feb 2001 12:24:14 +0000


strace expects the syscall number to be preserved in r20 over a syscall.
We didn't do that for fork(), where sys_fork_wrapper uses r19, 20, and 21
to pass arguments to the child.

===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/entry.S,v
retrieving revision 1.70
diff -u -r1.70 entry.S
--- entry.S     2001/02/16 03:00:39     1.70
+++ entry.S     2001/02/19 12:14:41
@@ -46,6 +46,7 @@
 #include <asm/pgtable.h>
 #include <asm/psw.h>
 #include <asm/signal.h>
+#include <asm/unistd.h>
 
 #ifdef __LP64__
 #define FRAME_SIZE     128
@@ -1782,6 +1783,9 @@
 
        reg_restore %r1
 
+       /* strace expects syscall # to be preserved in r20 */
+       ldi     __NR_fork,%r20
+       STREG   %r20,PT_GR20(%r1)
        bv %r0(%r2)
        nop