Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jun 2006 12:54:03 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 99220 for review
Message-ID:  <200606141254.k5ECs30G094128@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=99220

Change 99220 by rdivacky@rdivacky_witten on 2006/06/14 12:53:58

	First attempt to make linux programs work under 2.6. There's still the setpgid/setpgrp
	problem but I am working on it. Now we can run most of the programs but some coredumps.

Affected files ...

.. //depot/projects/soc2006/rdivacky_linuxolator/amd64/linux32/linux32_machdep.c#2 edit
.. //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_machdep.c#2 edit

Differences ...

==== //depot/projects/soc2006/rdivacky_linuxolator/amd64/linux32/linux32_machdep.c#2 (text+ko) ====

@@ -496,9 +496,6 @@
 	}
 #endif
 
-	if (!args->stack)
-		return (EINVAL);
-
 	exit_signal = args->flags & 0x000000ff;
 	if (exit_signal >= LINUX_NSIG)
 		return (EINVAL);
@@ -522,7 +519,11 @@
 	p2->p_sigparent = exit_signal;
 	PROC_UNLOCK(p2);
 	td2 = FIRST_THREAD_IN_PROC(p2);
-	td2->td_frame->tf_rsp = PTROUT(args->stack);
+	/* XXX: in a case of stack = NULL we are supposed to COW calling process stack
+	 * this is what normal fork() does so we just keep the tf_esp arg intact
+	 */
+	if (args->stack)
+   	   	td2->td_frame->tf_rsp = PTROUT(args->stack);
 
 #ifdef DEBUG
 	if (ldebug(clone))

==== //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_machdep.c#2 (text+ko) ====

@@ -334,9 +334,6 @@
 	}
 #endif
 
-	if (!args->stack)
-		return (EINVAL);
-
 	exit_signal = args->flags & 0x000000ff;
 	if (exit_signal >= LINUX_NSIG)
 		return (EINVAL);
@@ -376,7 +373,11 @@
 	p2->p_sigparent = exit_signal;
 	PROC_UNLOCK(p2);
 	td2 = FIRST_THREAD_IN_PROC(p2);
-	td2->td_frame->tf_esp = (unsigned int)args->stack;
+	/* XXX: in a case of stack = NULL we are supposed to COW calling process stack
+	 * this is what normal fork() does so we just keep the tf_esp arg intact
+	 */
+	if (args->stack)
+   	   	td2->td_frame->tf_esp = (unsigned int)args->stack;
 
 #ifdef DEBUG
 	if (ldebug(clone))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606141254.k5ECs30G094128>