PERFORCE change 136414 for review
Randall R. Stewart
rrs at FreeBSD.org
Fri Feb 29 19:47:43 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=136414
Change 136414 by rrs at 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);
More information about the p4-projects
mailing list