Resent-Date: Fri, 15 Jan 1999 10:39:36 +0100 (MET)
To: linux-m68k@lists.linux-m68k.org
Subject: 2.2.0-pre6
X-Yow: America!!  I saw it all!!  Vomiting!  Waving!  JERRY FALWELLING into
 your void tube of UHF oblivion!!  SAFEWAY of the mind --
From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Date: 15 Jan 1999 10:39:31 +0100
Resent-From: linux-m68k@phil.uni-sb.de

Well, you guess it :-)

- fix sys_vfork to put a SWITCH_STACK on the stack.
- modernize sys_ptrace.

Note, i have not booted it yet (still compiling right now :-( ).

Andreas.


--- linux/arch/m68k/kernel/entry.S.~1~	Wed Jan 13 18:02:26 1999
+++ linux/arch/m68k/kernel/entry.S	Wed Jan 13 18:23:35 1999
@@ -45,7 +45,7 @@
 .globl SYMBOL_NAME(resume), SYMBOL_NAME(ret_from_exception)
 .globl SYMBOL_NAME(ret_from_signal)
 .globl SYMBOL_NAME(inthandler), SYMBOL_NAME(sys_call_table)
-.globl SYMBOL_NAME(sys_fork), SYMBOL_NAME(sys_clone)
+.globl SYMBOL_NAME(sys_fork), SYMBOL_NAME(sys_clone), SYMBOL_NAME(sys_vfork)
 .globl SYMBOL_NAME(ret_from_interrupt), SYMBOL_NAME(bad_interrupt)
 
 .text
@@ -208,6 +208,14 @@
 	SAVE_SWITCH_STACK
 	pea	%sp@(SWITCH_STACK_SIZE)
 	jbsr	SYMBOL_NAME(m68k_clone)
+	addql	#4,%sp
+	RESTORE_SWITCH_STACK
+	rts
+
+ENTRY(sys_vfork)
+	SAVE_SWITCH_STACK	
+	pea	%sp@(SWITCH_STACK_SIZE)
+	jbsr	SYMBOL_NAME(m68k_vfork)
 	addql	#4,%sp
 	RESTORE_SWITCH_STACK
 	rts
--- linux/arch/m68k/kernel/process.c.~1~	Wed Jan 13 18:02:33 1999
+++ linux/arch/m68k/kernel/process.c	Wed Jan 13 19:05:49 1999
@@ -167,7 +167,7 @@
 	return do_fork(SIGCHLD, rdusp(), regs);
 }
 
-asmlinkage int sys_vfork(struct pt_regs *regs)
+asmlinkage int m68k_vfork(struct pt_regs *regs)
 {
 	int     child;
 
--- linux/arch/m68k/kernel/ptrace.c.~1~	Mon Jan  4 19:30:04 1999
+++ linux/arch/m68k/kernel/ptrace.c	Mon Jan 11 18:31:07 1999
@@ -325,12 +325,15 @@
 		ret = 0;
 		goto out;
 	}
-	if (pid == 1)		/* you may not mess with init */
-		goto out;
 	ret = -ESRCH;
-	if (!(child = find_task_by_pid(pid)))
+	read_lock(&tasklist_lock);
+	child = find_task_by_pid(pid);
+	read_unlock(&tasklist_lock);	/* FIXME!!! */
+	if (!child)
 		goto out;
 	ret = -EPERM;
+	if (pid == 1)		/* you may not mess with init */
+		goto out;
 	if (request == PTRACE_ATTACH) {
 		if (child == current)
 			goto out;

-- 
Andreas Schwab                                      "And now for something
schwab@issan.cs.uni-dortmund.de                      completely different"
schwab@gnu.org

