From owner-p4-projects@FreeBSD.ORG Wed Jun 14 12:56:27 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1342C16A47B; Wed, 14 Jun 2006 12:56:27 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC03916A474 for ; Wed, 14 Jun 2006 12:56:26 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9473A43D46 for ; Wed, 14 Jun 2006 12:56:26 +0000 (GMT) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5ECs32t094131 for ; Wed, 14 Jun 2006 12:54:03 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5ECs30G094128 for perforce@freebsd.org; Wed, 14 Jun 2006 12:54:03 GMT (envelope-from rdivacky@FreeBSD.org) Date: Wed, 14 Jun 2006 12:54:03 GMT Message-Id: <200606141254.k5ECs30G094128@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 99220 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jun 2006 12:56:27 -0000 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))