Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Feb 2008 21:56:26 GMT
From:      Olivier Houchard <cognet@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 134746 for review
Message-ID:  <200802032156.m13LuQ87061460@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=134746

Change 134746 by cognet@cognet-mips on 2008/02/03 21:56:13

	grrr switch to using KSEG0 for td_kframe for now. If we keep it that
	way, please remember to switch back KSTACK_PAGES to 2.

Affected files ...

.. //depot/projects/mips2-jnpr/src/sys/mips/mips/vm_machdep.c#16 edit

Differences ...

==== //depot/projects/mips2-jnpr/src/sys/mips/mips/vm_machdep.c#16 (text+ko) ====

@@ -107,17 +107,23 @@
 {
 	register struct proc *p1;
 	struct pcb *pcb2;
+#if 0
 	pt_entry_t *pte;
 	int i;
+#endif
 
 	p1 = td1->td_proc;
 	if ((flags & RFPROC) == 0)
 		return;
 
+#if 0
 	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;
+#endif
+	td2->td_md.md_realstack = 
+	    MIPS_PHYS_TO_KSEG0(MIPS_CACHED_TO_PHYS((vm_offset_t)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;
@@ -143,6 +149,7 @@
 	td2->td_frame->v1 = 1;
 	td2->td_frame->a3 = 0;
 
+#if 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);
@@ -151,6 +158,7 @@
 		td2->td_md.md_upte[i] = *pte & ~(PG_RO|PG_WIRED);
 		pte++;
 	}
+#endif
 
 	if (td1 == PCPU_GET(fpcurthread))
 		MipsSaveCurFPState(td1);
@@ -221,6 +229,7 @@
 void
 cpu_thread_swapin(struct thread *td)
 {
+#if 0
 	pt_entry_t *pte;
 	int i;
 
@@ -238,6 +247,7 @@
 		td->td_md.md_upte[i] = *pte & ~(PG_RO|PG_WIRED);
 		pte++;
 	}
+#endif
 }
 
 void
@@ -248,6 +258,7 @@
 void
 cpu_thread_alloc(struct thread *td)
 {
+#if 0
 	pt_entry_t *pte;
 	int i;
 
@@ -255,11 +266,15 @@
 		td->td_md.md_realstack = td->td_kstack + PAGE_SIZE;
 	else
 		td->td_md.md_realstack = td->td_kstack;
+#endif
 
+	td->td_md.md_realstack =
+	    MIPS_PHYS_TO_KSEG0(MIPS_CACHED_TO_PHYS((vm_offset_t)td->td_kstack));
 	td->td_pcb = (struct pcb *)(td->td_md.md_realstack +
 	    (td->td_kstack_pages - 1) * PAGE_SIZE) - 1;
 	td->td_frame = &td->td_pcb->pcb_regs;
 
+#if 0
 	if (!(pte = pmap_segmap(kernel_pmap, td->td_md.md_realstack)))
 		panic("cpu_thread_alloc: invalid segmap");
 	pte += ((vm_offset_t)td->td_md.md_realstack >> PGSHIFT) & (NPTEPG - 1);
@@ -268,6 +283,7 @@
 		td->td_md.md_upte[i] = *pte & ~(PG_RO|PG_WIRED);
 		pte++;
 	}
+#endif
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802032156.m13LuQ87061460>