Simplify pmap_extract()'s control flow, making it more like the related
functions pmap_extract_and_hold() and pmap_kextract().
This commit is contained in:
parent
2bb0f7ba54
commit
53d13c6030
@ -986,13 +986,12 @@ pmap_extract(pmap_t pmap, vm_offset_t va)
|
||||
if (pdep != NULL) {
|
||||
pde = *pdep;
|
||||
if (pde) {
|
||||
if ((pde & PG_PS) != 0) {
|
||||
if ((pde & PG_PS) != 0)
|
||||
rtval = (pde & PG_PS_FRAME) | (va & PDRMASK);
|
||||
PMAP_UNLOCK(pmap);
|
||||
return rtval;
|
||||
else {
|
||||
pte = pmap_pde_to_pte(pdep, va);
|
||||
rtval = (*pte & PG_FRAME) | (va & PAGE_MASK);
|
||||
}
|
||||
pte = pmap_pde_to_pte(pdep, va);
|
||||
rtval = (*pte & PG_FRAME) | (va & PAGE_MASK);
|
||||
}
|
||||
}
|
||||
PMAP_UNLOCK(pmap);
|
||||
|
@ -1063,14 +1063,13 @@ pmap_extract(pmap_t pmap, vm_offset_t va)
|
||||
PMAP_LOCK(pmap);
|
||||
pde = pmap->pm_pdir[va >> PDRSHIFT];
|
||||
if (pde != 0) {
|
||||
if ((pde & PG_PS) != 0) {
|
||||
if ((pde & PG_PS) != 0)
|
||||
rtval = (pde & PG_PS_FRAME) | (va & PDRMASK);
|
||||
PMAP_UNLOCK(pmap);
|
||||
return rtval;
|
||||
else {
|
||||
pte = pmap_pte(pmap, va);
|
||||
rtval = (*pte & PG_FRAME) | (va & PAGE_MASK);
|
||||
pmap_pte_release(pte);
|
||||
}
|
||||
pte = pmap_pte(pmap, va);
|
||||
rtval = (*pte & PG_FRAME) | (va & PAGE_MASK);
|
||||
pmap_pte_release(pte);
|
||||
}
|
||||
PMAP_UNLOCK(pmap);
|
||||
return (rtval);
|
||||
|
Loading…
x
Reference in New Issue
Block a user