In pmap_testbit(), if we end up traversing the PV list, cache a hit on the

bit to speed future tests.
This commit is contained in:
thorpej 1998-12-19 23:21:51 +00:00
parent 23933685ff
commit 6659e7174e
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.54 1998/12/19 23:01:47 thorpej Exp $ */
/* $NetBSD: pmap.c,v 1.55 1998/12/19 23:21:51 thorpej Exp $ */
/*
* Copyright (c) 1991, 1993
@ -2282,13 +2282,14 @@ pmap_testbit(pa, bit)
DCIS();
#endif
/*
* Not found, check current mappings returning
* immediately if found.
* Not found. Check current mappings, returning immediately if
* found. Cache a hit to speed future lookups.
*/
if (pv->pv_pmap != NULL) {
for (; pv; pv = pv->pv_next) {
pte = pmap_pte(pv->pv_pmap, pv->pv_va);
if (*pte & bit) {
*pa_to_attribute(pa) |= bit;
splx(s);
return(TRUE);
}