From owner-p4-projects@FreeBSD.ORG Fri Feb 29 19:47:43 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BAAB31065B9E; Fri, 29 Feb 2008 19:47:42 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2A0610657FC for ; Fri, 29 Feb 2008 19:47:39 +0000 (UTC) (envelope-from rrs@cisco.com) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C26DD8FC1A for ; Fri, 29 Feb 2008 19:47:39 +0000 (UTC) (envelope-from rrs@cisco.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m1TJldLU092286 for ; Fri, 29 Feb 2008 19:47:39 GMT (envelope-from rrs@cisco.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1TJld63092284 for perforce@freebsd.org; Fri, 29 Feb 2008 19:47:39 GMT (envelope-from rrs@cisco.com) Date: Fri, 29 Feb 2008 19:47:39 GMT Message-Id: <200802291947.m1TJld63092284@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rrs@cisco.com using -f From: "Randall R. Stewart" To: Perforce Change Reviews Cc: Subject: PERFORCE change 136414 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Feb 2008 19:47:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=136414 Change 136414 by rrs@rrs-mips2-jnpr on 2008/02/28 09:44:13 purge out duplicate code that is done in cpu_thread_alloc() Affected files ... .. //depot/projects/mips2-jnpr/src/sys/mips/mips/vm_machdep.c#19 edit Differences ... ==== //depot/projects/mips2-jnpr/src/sys/mips/mips/vm_machdep.c#19 (text+ko) ==== @@ -107,21 +107,16 @@ { register struct proc *p1; struct pcb *pcb2; - pt_entry_t *pte; - int i; p1 = td1->td_proc; if ((flags & RFPROC) == 0) return; + /* It is assumed that the vm_thread_alloc called + * cpu_thread_alloc() before cpu_fork is called. + */ - if(td2->td_kstack & (1 << PAGE_SHIFT)) - td2->td_md.md_realstack = td2->td_kstack + PAGE_SIZE; - else - td2->td_md.md_realstack = td2->td_kstack; /* Point the pcb to the top of the stack */ - pcb2 = (struct pcb *)(td2->td_md.md_realstack + - (td2->td_kstack_pages - 1) * PAGE_SIZE) - 1; - td2->td_pcb = pcb2; + pcb2 = td2->td_pcb; /* Copy p1's pcb */ bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); @@ -130,10 +125,6 @@ * md_proc is empty for MIPS */ - /* Set up the trapframe pointer for the thread. trapframe - * is the first entry of the pcb - */ - td2->td_frame = &td2->td_pcb->pcb_regs; td2->td_md.md_flags = td1->td_md.md_flags & MDTD_FPUSED; /* @@ -143,15 +134,6 @@ td2->td_frame->v1 = 1; td2->td_frame->a3 = 0; - if (!(pte = pmap_segmap(kernel_pmap, td2->td_md.md_realstack))) - panic("cpu_fork: invalid segmap"); - pte += ((vm_offset_t)td2->td_md.md_realstack >> PGSHIFT) & (NPTEPG - 1); - - for (i = 0; i < KSTACK_PAGES - 1; i++) { - td2->td_md.md_upte[i] = *pte & ~(PG_RO|PG_WIRED); - pte++; - } - if (td1 == PCPU_GET(fpcurthread)) MipsSaveCurFPState(td1);