Module Name:    src
Committed By:   riz
Date:           Wed May  9 20:09:15 UTC 2012

Modified Files:
        src/sys/arch/powerpc/powerpc [netbsd-6]: vm_machdep.c

Log Message:
Pull up following revision(s) (requested by matt in ticket #239):
        sys/arch/powerpc/powerpc/vm_machdep.c: revision 1.96
When a stack is specified, make sure the stack has enough for a previous
callframe in which the LR can be stored.  (atf test t_clone:clone_basic
now passes).


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.94.2.1 src/sys/arch/powerpc/powerpc/vm_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/powerpc/powerpc/vm_machdep.c
diff -u src/sys/arch/powerpc/powerpc/vm_machdep.c:1.94 src/sys/arch/powerpc/powerpc/vm_machdep.c:1.94.2.1
--- src/sys/arch/powerpc/powerpc/vm_machdep.c:1.94	Mon Feb 13 13:44:14 2012
+++ src/sys/arch/powerpc/powerpc/vm_machdep.c	Wed May  9 20:09:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.94 2012/02/13 13:44:14 phx Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.94.2.1 2012/05/09 20:09:15 riz Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.94 2012/02/13 13:44:14 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.94.2.1 2012/05/09 20:09:15 riz Exp $");
 
 #include "opt_altivec.h"
 #include "opt_multiprocessor.h"
@@ -108,10 +108,13 @@ cpu_lwp_fork(struct lwp *l1, struct lwp 
 	*l2->l_md.md_utf = *l1->l_md.md_utf;
 
 	/*
-	 * If specified, give the child a different stack.
+	 * If specified, give the child a different stack.  Make sure to
+	 * reserve enough at the top to store the previous LR.
 	 */
 	if (stack != NULL) {
-		l2->l_md.md_utf->tf_fixreg[1] = (register_t)stack + stacksize;
+		l2->l_md.md_utf->tf_fixreg[1] =	
+		    ((register_t)stack + stacksize - STACK_ALIGNBYTES)
+			& ~STACK_ALIGNBYTES;
 	}
 
 	/*

Reply via email to