Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Oct 2012 05:42:15 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241156 - head/sys/mips/mips
Message-ID:  <201210030542.q935gFqQ072749@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Wed Oct  3 05:42:15 2012
New Revision: 241156
URL: http://svn.freebsd.org/changeset/base/241156

Log:
  Reimplement pmap_qremove() using the new TLB invalidation function for
  efficiently invalidating address ranges.

Modified:
  head/sys/mips/mips/pmap.c

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Wed Oct  3 05:06:45 2012	(r241155)
+++ head/sys/mips/mips/pmap.c	Wed Oct  3 05:42:15 2012	(r241156)
@@ -930,15 +930,19 @@ pmap_qenter(vm_offset_t va, vm_page_t *m
 void
 pmap_qremove(vm_offset_t va, int count)
 {
-	/*
-	 * No need to wb/inv caches here, 
-	 *   pmap_kremove will do it for us
-	 */
+	pt_entry_t *pte;
+	vm_offset_t origva;
 
-	while (count-- > 0) {
-		pmap_kremove(va);
+	if (count < 1)
+		return;
+	mips_dcache_wbinv_range_index(va, PAGE_SIZE * count);
+	origva = va;
+	do {
+		pte = pmap_pte(kernel_pmap, va);
+		*pte = PTE_G;
 		va += PAGE_SIZE;
-	}
+	} while (--count > 0);
+	pmap_invalidate_range(kernel_pmap, origva, va);
 }
 
 /***************************************************



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