diff options
author | alc <alc@FreeBSD.org> | 2004-12-02 03:29:17 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-12-02 03:29:17 +0000 |
commit | 38bcfbb659366dda03f60671c5f354cecd295cb4 (patch) | |
tree | ab1e3f151eac940481b2f7cc88e61b6845b9f751 /sys/i386 | |
parent | 966df7ef38bfc1b9d5a1dbb895c14aa2f3b9c9dc (diff) | |
download | FreeBSD-src-38bcfbb659366dda03f60671c5f354cecd295cb4.zip FreeBSD-src-38bcfbb659366dda03f60671c5f354cecd295cb4.tar.gz |
For efficiency move the call to pmap_pte_quick() out of pmap_protect()'s
and pmap_remove()'s inner loop.
Reviewed by: peter@, tegge@
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/pmap.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index b8dea6f..5a47d87 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -1673,9 +1673,9 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) if (pdnxt > eva) pdnxt = eva; - for (; sva != pdnxt; sva += PAGE_SIZE) { - if ((pte = pmap_pte_quick(pmap, sva)) == NULL || - *pte == 0) + for (pte = pmap_pte_quick(pmap, sva); sva != pdnxt; pte++, + sva += PAGE_SIZE) { + if (*pte == 0) continue; anyvalid = 1; if (pmap_remove_pte(pmap, pte, sva)) @@ -1765,6 +1765,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { vm_offset_t pdnxt; pd_entry_t ptpaddr; + pt_entry_t *pte; int anychanged; if ((prot & VM_PROT_READ) == VM_PROT_NONE) { @@ -1808,12 +1809,10 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) if (pdnxt > eva) pdnxt = eva; - for (; sva != pdnxt; sva += PAGE_SIZE) { - pt_entry_t *pte; + for (pte = pmap_pte_quick(pmap, sva); sva != pdnxt; pte++, + sva += PAGE_SIZE) { vm_page_t m; - if ((pte = pmap_pte_quick(pmap, sva)) == NULL) - continue; retry: /* * Regardless of whether a pte is 32 or 64 bits in |