Module Name:    src
Committed By:   matt
Date:           Tue Dec 15 18:24:47 UTC 2009

Modified Files:
        src/sys/arch/mips/mips: mips_machdep.c

Log Message:
Make sure the pcb and initial frame area of lwp0 are zeroed since these will
be the basis for all future lwps.


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/sys/arch/mips/mips/mips_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/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.223 src/sys/arch/mips/mips/mips_machdep.c:1.224
--- src/sys/arch/mips/mips/mips_machdep.c:1.223	Mon Dec 14 00:46:06 2009
+++ src/sys/arch/mips/mips/mips_machdep.c	Tue Dec 15 18:24:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.223 2009/12/14 00:46:06 matt Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.224 2009/12/15 18:24:47 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.223 2009/12/14 00:46:06 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.224 2009/12/15 18:24:47 matt Exp $");
 
 #include "opt_cputype.h"
 #include "opt_compat_netbsd32.h"
@@ -1649,6 +1649,11 @@
 
 	struct pcb * const pcb0 = lwp_getpcb(&lwp0);
 	lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1;
+	/*
+	 * Now zero out the only two areas of the uarea that we care about.
+	 */
+	memset(lwp0.l_md.md_regs, 0, sizeof(*lwp0.l_md.md_regs));
+	memset(pcb0, 0, sizeof(*pcb0));
 #ifdef _LP64
 	lwp0.l_md.md_regs->f_regs[_R_SR] = MIPS_SR_KX;
 #endif

Reply via email to