From 54f3305ccaf6f7eb62856fb2ec5fb743584ae151 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 3 Oct 2012 05:42:15 +0000 Subject: [PATCH] Reimplement pmap_qremove() using the new TLB invalidation function for efficiently invalidating address ranges. --- sys/mips/mips/pmap.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c index c41b8623223f..bd77bae9fb70 100644 --- a/sys/mips/mips/pmap.c +++ b/sys/mips/mips/pmap.c @@ -930,15 +930,19 @@ pmap_qenter(vm_offset_t va, vm_page_t *m, int count) 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); } /***************************************************