From e43e24711bce370fd99412e829dcc38c04e7a7b5 Mon Sep 17 00:00:00 2001 From: Jake Burkholder Date: Sat, 21 Dec 2002 10:44:30 +0000 Subject: [PATCH] Make pmap_qenter and pmap_qremove look more like the other pmaps. --- sys/sparc64/sparc64/pmap.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c index c3d27f5d107b..3e29af76e02a 100644 --- a/sys/sparc64/sparc64/pmap.c +++ b/sys/sparc64/sparc64/pmap.c @@ -935,12 +935,14 @@ void pmap_qenter(vm_offset_t sva, vm_page_t *m, int count) { vm_offset_t va; - int i; va = sva; - for (i = 0; i < count; i++, va += PAGE_SIZE) - pmap_kenter(va, VM_PAGE_TO_PHYS(m[i])); - tlb_range_demap(kernel_pmap, sva, sva + (count * PAGE_SIZE) - 1); + while (count-- > 0) { + pmap_kenter(va, VM_PAGE_TO_PHYS(*m)); + va += PAGE_SIZE; + m++; + } + tlb_range_demap(kernel_pmap, sva, va); } /* @@ -951,12 +953,13 @@ void pmap_qremove(vm_offset_t sva, int count) { vm_offset_t va; - int i; va = sva; - for (i = 0; i < count; i++, va += PAGE_SIZE) + while (count-- > 0) { pmap_kremove(va); - tlb_range_demap(kernel_pmap, sva, sva + (count * PAGE_SIZE) - 1); + va += PAGE_SIZE; + } + tlb_range_demap(kernel_pmap, sva, va); } #ifndef KSTACK_MAX_PAGES