Pullup across/adapt fix from OpenBSD:

Properly initialize the members of `struct mdproc' that deal with
single-stepping when we fork and reset them upon exec.
This commit is contained in:
skrll 2010-06-06 09:12:39 +00:00
parent 62bfdd2b21
commit 2c2594876d
2 changed files with 10 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.85 2010/06/01 10:20:29 skrll Exp $ */
/* $NetBSD: machdep.c,v 1.86 2010/06/06 09:12:39 skrll Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.85 2010/06/01 10:20:29 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.86 2010/06/06 09:12:39 skrll Exp $");
#include "opt_cputype.h"
#include "opt_ddb.h"
@ -1880,6 +1880,8 @@ setregs(struct lwp *l, struct exec_package *pack, vaddr_t stack)
pcb->pcb_fpregs->fpr_regs[2] = 0;
pcb->pcb_fpregs->fpr_regs[3] = 0;
l->l_md.md_bpva = 0;
/* setup terminal stack frame */
stack = (u_long)STACK_ALIGN(stack, 63);
tf->tf_r3 = stack;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.44 2010/04/03 07:46:02 skrll Exp $ */
/* $NetBSD: vm_machdep.c,v 1.45 2010/06/06 09:12:39 skrll Exp $ */
/* $OpenBSD: vm_machdep.c,v 1.64 2008/09/30 18:54:26 miod Exp $ */
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.44 2010/04/03 07:46:02 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.45 2010/06/06 09:12:39 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -112,6 +112,10 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
pcb2->pcb_fpregs->fpr_regs[2] = 0;
pcb2->pcb_fpregs->fpr_regs[3] = 0;
l2->l_md.md_bpva = l1->l_md.md_bpva;
l2->l_md.md_bpsave[0] = l1->l_md.md_bpsave[0];
l2->l_md.md_bpsave[1] = l1->l_md.md_bpsave[1];
uv = uvm_lwp_getuarea(l2);
sp = (register_t)uv + PAGE_SIZE;
l2->l_md.md_regs = tf = (struct trapframe *)sp;