Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Nov 2003 11:27:11 -0800 (PST)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 41124 for review
Message-ID:  <200311021927.hA2JRBhv018171@repoman.freebsd.org>

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

Change 41124 by jmallett@jmallett_dalek on 2003/11/02 11:27:07

	Do things a little more programmatically.

Affected files ...

.. //depot/projects/mips/sys/mips/mips/tlb.c#8 edit

Differences ...

==== //depot/projects/mips/sys/mips/mips/tlb.c#8 (text+ko) ====

@@ -106,6 +106,9 @@
 	pte = tlb_pte_find(pmap->pm_lev1, va);
 	if (pte_valid(pte))
 		tlb_invalidate_page(va);
+	if ((bits & PG_V) == 0)
+		printf("pmap %p entering invalid mapping for va %lx to pa %lx [%lx]\n",
+		       pmap, (u_long)va, (u_long)pa, (u_long)bits);
 	*pte = MIPS_PA_TO_PFN(pa) | bits | PG_G;
 }
 
@@ -140,11 +143,18 @@
 static void
 tlb_insert(vm_offset_t va, pt_entry_t pte0, pt_entry_t pte1)
 {
+	u_long ehi;
+
 	va &= ~PAGE_MASK;
-	/* XXX assumes kernel region - region 3. */
-	mips_wr_entryhi(MIPS_HI_R_KERNEL | MIPS_HI_VA_TO_VPN2(va) /* XXX | ASID */);
-	mips_wr_entrylo0(pte0);
-	mips_wr_entrylo1(pte1);
+	ehi = 0;
+	ehi |= (va & (1UL << 63 | 1UL << 62));
+	if ((va & (1UL << 63)) != 0)
+		ehi |= (0x800000UL - 1) << 40;
+	ehi |= MIPS_HI_VA_TO_VPN2(va);
+	ehi |= /* asid */0;
+	mips_wr_entryhi(ehi);
+	mips_wr_entrylo0(pte0 | PG_G);
+	mips_wr_entrylo1(pte1 | PG_G);
 	mips_tlbwr();
 }
 
@@ -192,7 +202,7 @@
 	 */
 	*pte |= PG_D;
 
-	if (va & PG_ODDPG) {
+	if ((va >> PAGE_SHIFT) & 1) {
 		tlb_update(va, pte[-1], pte[0]);
 	} else {
 		tlb_update(va, pte[0], pte[1]);



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