Module Name: src Committed By: matt Date: Fri Feb 5 17:16:05 UTC 2010
Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: vm_machdep.c Log Message: remove a debugging printf. cleanup the reinit of the lwp. To generate a diff of this commit: cvs rdiff -u -r1.121.6.1.2.10 -r1.121.6.1.2.11 \ src/sys/arch/mips/mips/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/mips/mips/vm_machdep.c diff -u src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.10 src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.11 --- src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.10 Fri Feb 5 07:36:50 2010 +++ src/sys/arch/mips/mips/vm_machdep.c Fri Feb 5 17:16:05 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.121.6.1.2.10 2010/02/05 07:36:50 matt Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.121.6.1.2.11 2010/02/05 17:16:05 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -80,7 +80,7 @@ #include "opt_coredump.h" #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.121.6.1.2.10 2010/02/05 07:36:50 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.121.6.1.2.11 2010/02/05 17:16:05 matt Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -151,7 +151,7 @@ * Copy l1 trapframe atop on l2 stack space, so return to user mode * will be to right address, with correct registers. */ - memcpy(&l2->l_addr->u_pcb, &l1->l_addr->u_pcb, sizeof(struct pcb)); + l2->l_addr->u_pcb = l1->l_addr->u_pcb; tf = (struct trapframe *)((char *)l2->l_addr + USPACE) - 1; *tf = *l1->l_md.md_utf; @@ -248,11 +248,7 @@ */ uarea_ok = uarea_ok && (pa + USPACE - 1 <= MIPS_PHYS_MASK); #endif - printf("ctx=%#"PRIxVADDR" utf=%p\n", - (vaddr_t)l->l_addr->u_pcb.pcb_context.val[_L_SP], - l->l_md.md_utf); KASSERT((vaddr_t)l->l_addr->u_pcb.pcb_context.val[_L_SP] == (vaddr_t)l->l_md.md_utf); - vaddr_t sp = l->l_addr->u_pcb.pcb_context.val[_L_SP] - (vaddr_t)l->l_addr; if (!uarea_ok) { struct pglist pglist; @@ -290,8 +286,11 @@ va = MIPS_PHYS_TO_KSEG0(pa); #endif if (!uarea_ok) { + /* + * Copy the trapframe and pcb from the old uarea to the new. + */ ((struct trapframe *)(va + USPACE))[-1] = *l->l_md.md_utf; - *(struct pcb *)va = l->l_addr->u_pcb; + ((struct user *)va)->u_pcb = l->l_addr->u_pcb; /* * Discard the old uarea. */ @@ -300,8 +299,8 @@ } l->l_addr = (struct user *)va; - l->l_addr->u_pcb.pcb_context.val[_L_SP] = sp + va; - l->l_md.md_utf = (struct trapframe *)((char *)l->l_addr + USPACE) - 1; + l->l_md.md_utf = (struct trapframe *)(va + USPACE) - 1; + l->l_addr->u_pcb.pcb_context.val[_L_SP] = (vaddr_t)l->l_md.md_utf; uarea_remapped.ev_count++; }