Resent-Date: Mon, 1 Nov 1999 10:30:08 +0100 (MET)
Sender: labr@ubi.se
Date: Mon, 01 Nov 1999 10:29:57 +0100
From: lars brinkhoff <lars.brinkhoff@intermec.com>
X-Accept-Language: en
To: Jes Sorensen <Jes.Sorensen@cern.ch>
CC: Roman Zippel <zippel@fh-brandenburg.de>, linux-m68k@lists.linux-m68k.org
Subject: Re: PATCH: syscall change patch, part II
References: <Pine.GSO.4.10.9910051845520.11789-100000@zeus.fh-brandenburg.de> <37FAF091.DF73FE24@intermec.com> <d3904jjyax.fsf@lxp03.cern.ch> <381D438F.A20C2A72@intermec.com> <d34sf61val.fsf@lxp03.cern.ch>
Resent-From: linux-m68k@phil.uni-sb.de

Jes Sorensen wrote:
> lars> What Roman suggested is exactly what Linux/ix86 does as of
> lars> 2.3.22, so I think we should do the same.
> All I am asking for is _one_ patch ;-)

Coming right up!  This is against 2.3.16, which was the latest kernel I
found on sunsite.dk.  This does, almost instruction by instruction, what
Linux 2.3.24/i386 does.

--- linux-2.3.16/arch/m68k/kernel/ptrace.c.orig	Mon Nov  1 10:11:31 1999
+++ linux-2.3.16/arch/m68k/kernel/ptrace.c	Mon Nov  1 10:11:58 1999
@@ -416,8 +416,6 @@
 
 			addr = addr >> 2; /* temporary hack. */
 			    
-			if (addr == PT_ORIG_D0)
-				goto out;
 			if (addr == PT_SR) {
 				data &= SR_MASK;
 				data <<= 16;
--- linux-2.3.16/arch/m68k/kernel/entry.S.orig	Mon Nov  1 10:12:10 1999
+++ linux-2.3.16/arch/m68k/kernel/entry.S	Mon Nov  1 10:18:51 1999
@@ -93,8 +93,12 @@
 	jbsr	SYMBOL_NAME(syscall_trace)
 	RESTORE_SWITCH_STACK
 	addql	#4,%sp
+	movel	PT_D0(%sp),%d2
+	cmpl	#NR_syscalls,%d2
+	jcc	do_trace_exit
 	jbsr	@(SYMBOL_NAME(sys_call_table),%d2:l:4)@(0)
 	movel	%d0,%sp@(PT_D0)		| save the return value
+do_trace_exit:
 	subql	#4,%sp			| dummy return address
 	SAVE_SWITCH_STACK
 	jbsr	SYMBOL_NAME(syscall_trace)

