From 2121e75b3fa31e6d2364ba426d44b9c9defea432 Mon Sep 17 00:00:00 2001 From: bjh21 Date: Sat, 14 Oct 2006 17:51:37 +0000 Subject: [PATCH] When forking a new LWP, if a new user stack pointer is provided, use it. Necessary to make regress/lib/libc/clone pass. --- sys/arch/acorn26/acorn26/vm_machdep.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/arch/acorn26/acorn26/vm_machdep.c b/sys/arch/acorn26/acorn26/vm_machdep.c index 11dc1d019223..2a8d85876eaa 100644 --- a/sys/arch/acorn26/acorn26/vm_machdep.c +++ b/sys/arch/acorn26/acorn26/vm_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.11 2006/05/10 06:24:02 skrll Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.12 2006/10/14 17:51:37 bjh21 Exp $ */ /*- * Copyright (c) 2000, 2001 Ben Harris @@ -64,7 +64,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.11 2006/05/10 06:24:02 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.12 2006/10/14 17:51:37 bjh21 Exp $"); #include #include @@ -128,6 +128,9 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize, bzero(tf, sizeof(*tf)); else *tf = *l1->l_addr->u_pcb.pcb_tf; + /* If specified, give the child a different stack. */ + if (stack != NULL) + tf->tf_usr_sp = (u_int)stack + stacksize; l2->l_addr->u_pcb.pcb_tf = tf; /* Fabricate a new switchframe */ bzero(sf, sizeof(*sf));