Simplify the control flow in pmap_extract(), enabling the elimination of a

PMAP_UNLOCK() call.
This commit is contained in:
Alan Cox 2004-07-07 16:47:58 +00:00
parent 9779075afa
commit 26a965568d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=131744
2 changed files with 6 additions and 8 deletions

View File

@ -766,8 +766,9 @@ pmap_extract(pmap_t pmap, vm_offset_t va)
pt_entry_t *pte;
pd_entry_t pde, *pdep;
rtval = 0;
if (pmap == NULL)
return 0;
return (rtval);
PMAP_LOCK(pmap);
pdep = pmap_pde(pmap, va);
if (pdep != NULL) {
@ -780,12 +781,10 @@ pmap_extract(pmap_t pmap, vm_offset_t va)
}
pte = pmap_pte(pmap, va);
rtval = (*pte & PG_FRAME) | (va & PAGE_MASK);
PMAP_UNLOCK(pmap);
return rtval;
}
}
PMAP_UNLOCK(pmap);
return 0;
return (rtval);
}
/*

View File

@ -827,8 +827,9 @@ pmap_extract(pmap_t pmap, vm_offset_t va)
pt_entry_t *pte;
pd_entry_t pde;
rtval = 0;
if (pmap == NULL)
return 0;
return (rtval);
PMAP_LOCK(pmap);
pde = pmap->pm_pdir[va >> PDRSHIFT];
if (pde != 0) {
@ -839,11 +840,9 @@ pmap_extract(pmap_t pmap, vm_offset_t va)
}
pte = pmap_pte(pmap, va);
rtval = (*pte & PG_FRAME) | (va & PAGE_MASK);
PMAP_UNLOCK(pmap);
return rtval;
}
PMAP_UNLOCK(pmap);
return 0;
return (rtval);
}
/*