Simplify the control flow in pmap_extract(), enabling the elimination of a
PMAP_UNLOCK() call.
This commit is contained in:
parent
9779075afa
commit
26a965568d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=131744
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user