svn commit: r189454 - head/sys/amd64/amd64
Alan Cox
alc at FreeBSD.org
Fri Mar 6 09:40:59 PST 2009
Author: alc
Date: Fri Mar 6 17:40:58 2009
New Revision: 189454
URL: http://svn.freebsd.org/changeset/base/189454
Log:
If the PDE is known, then use the direct mapping instead of the recursive
mapping to access the PTE.
Modified:
head/sys/amd64/amd64/pmap.c
Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c Fri Mar 6 17:13:12 2009 (r189453)
+++ head/sys/amd64/amd64/pmap.c Fri Mar 6 17:40:58 2009 (r189454)
@@ -3801,7 +3801,9 @@ pmap_remove_pages(pmap_t pmap)
if ((tpte & PG_PS) != 0)
pte = pde;
else {
- pte = vtopte(pv->pv_va);
+ pte = (pt_entry_t *)PHYS_TO_DMAP(tpte &
+ PG_FRAME);
+ pte = &pte[pmap_pte_index(pv->pv_va)];
tpte = *pte & ~PG_PTE_PAT;
}
@@ -4494,7 +4496,7 @@ pmap_change_attr_locked(vm_offset_t va,
if (!pmap_demote_pde(kernel_pmap, pde, tmpva))
return (ENOMEM);
}
- pte = vtopte(tmpva);
+ pte = pmap_pde_to_pte(pde, tmpva);
if (*pte == 0)
return (EINVAL);
tmpva += PAGE_SIZE;
@@ -4570,7 +4572,7 @@ pmap_change_attr_locked(vm_offset_t va,
} else {
if (cache_bits_pte < 0)
cache_bits_pte = pmap_cache_bits(mode, 0);
- pte = vtopte(tmpva);
+ pte = pmap_pde_to_pte(pde, tmpva);
if ((*pte & PG_PTE_CACHE) != cache_bits_pte) {
pmap_pte_attr(pte, cache_bits_pte);
if (!changed)
More information about the svn-src-all
mailing list