The machine-independent parts of the virtual memory system always pass a
valid pmap to the pmap functions that require one. Remove the checks for NULL. (These checks have their origins in the Mach pmap.c that was integrated into BSD. None of the new code written specifically for FreeBSD included them.)
This commit is contained in:
parent
24114d445c
commit
8991a235cb
@ -747,8 +747,6 @@ pmap_extract(pmap_t pmap, vm_offset_t va)
|
||||
vm_paddr_t pa;
|
||||
|
||||
pa = 0;
|
||||
if (pmap == NULL)
|
||||
return (pa);
|
||||
PMAP_LOCK(pmap);
|
||||
pte = pmap_lev3pte(pmap, va);
|
||||
if (pte != NULL && pmap_pte_v(pte))
|
||||
@ -771,8 +769,6 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
|
||||
vm_page_t m;
|
||||
|
||||
m = NULL;
|
||||
if (pmap == NULL)
|
||||
return (m);
|
||||
vm_page_lock_queues();
|
||||
PMAP_LOCK(pmap);
|
||||
pte = pmap_lev3pte(pmap, va);
|
||||
@ -1468,9 +1464,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
|
||||
{
|
||||
vm_offset_t va, nva;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Perform an unsynchronized read. This is, however, safe.
|
||||
*/
|
||||
@ -1586,9 +1579,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot)
|
||||
pt_entry_t* pte;
|
||||
int newprot;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
if ((prot & VM_PROT_READ) == VM_PROT_NONE) {
|
||||
pmap_remove(pmap, sva, eva);
|
||||
return;
|
||||
@ -1681,9 +1671,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
|
||||
vm_page_t mpte;
|
||||
int managed;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
va &= ~PAGE_MASK;
|
||||
#ifdef PMAP_DIAGNOSTIC
|
||||
if (va > VM_MAX_KERNEL_ADDRESS)
|
||||
@ -1965,9 +1952,6 @@ pmap_change_wiring(pmap, va, wired)
|
||||
{
|
||||
pt_entry_t *pte;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
PMAP_LOCK(pmap);
|
||||
pte = pmap_lev3pte(pmap, va);
|
||||
|
||||
|
@ -786,8 +786,6 @@ pmap_extract(pmap_t pmap, vm_offset_t va)
|
||||
pd_entry_t pde, *pdep;
|
||||
|
||||
rtval = 0;
|
||||
if (pmap == NULL)
|
||||
return (rtval);
|
||||
PMAP_LOCK(pmap);
|
||||
pdep = pmap_pde(pmap, va);
|
||||
if (pdep != NULL) {
|
||||
@ -821,8 +819,6 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
|
||||
vm_page_t m;
|
||||
|
||||
m = NULL;
|
||||
if (pmap == NULL)
|
||||
return (m);
|
||||
vm_page_lock_queues();
|
||||
PMAP_LOCK(pmap);
|
||||
pdep = pmap_pde(pmap, va);
|
||||
@ -1563,9 +1559,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
|
||||
pt_entry_t *pte;
|
||||
int anyvalid;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Perform an unsynchronized read. This is, however, safe.
|
||||
*/
|
||||
@ -1737,9 +1730,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot)
|
||||
pd_entry_t ptpaddr, *pde;
|
||||
int anychanged;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
if ((prot & VM_PROT_READ) == VM_PROT_NONE) {
|
||||
pmap_remove(pmap, sva, eva);
|
||||
return;
|
||||
@ -1856,9 +1846,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
|
||||
pt_entry_t origpte, newpte;
|
||||
vm_page_t mpte;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
va = trunc_page(va);
|
||||
#ifdef PMAP_DIAGNOSTIC
|
||||
if (va > VM_MAX_KERNEL_ADDRESS)
|
||||
@ -2211,9 +2198,6 @@ pmap_change_wiring(pmap, va, wired)
|
||||
{
|
||||
register pt_entry_t *pte;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Wiring is not a hardware characteristic so there is no need to
|
||||
* invalidate TLB.
|
||||
|
@ -827,8 +827,6 @@ pmap_extract(pmap_t pmap, vm_offset_t va)
|
||||
pd_entry_t pde;
|
||||
|
||||
rtval = 0;
|
||||
if (pmap == NULL)
|
||||
return (rtval);
|
||||
PMAP_LOCK(pmap);
|
||||
pde = pmap->pm_pdir[va >> PDRSHIFT];
|
||||
if (pde != 0) {
|
||||
@ -859,8 +857,6 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
|
||||
vm_page_t m;
|
||||
|
||||
m = NULL;
|
||||
if (pmap == NULL)
|
||||
return (m);
|
||||
vm_page_lock_queues();
|
||||
PMAP_LOCK(pmap);
|
||||
pde = *pmap_pde(pmap, va);
|
||||
@ -1630,9 +1626,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
|
||||
pt_entry_t *pte;
|
||||
int anyvalid;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Perform an unsynchronized read. This is, however, safe.
|
||||
*/
|
||||
@ -1789,9 +1782,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot)
|
||||
pd_entry_t ptpaddr;
|
||||
int anychanged;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
if ((prot & VM_PROT_READ) == VM_PROT_NONE) {
|
||||
pmap_remove(pmap, sva, eva);
|
||||
return;
|
||||
@ -1894,9 +1884,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
|
||||
pt_entry_t origpte, newpte;
|
||||
vm_page_t mpte;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
va &= PG_FRAME;
|
||||
#ifdef PMAP_DIAGNOSTIC
|
||||
if (va > VM_MAX_KERNEL_ADDRESS)
|
||||
@ -2264,9 +2251,6 @@ pmap_change_wiring(pmap, va, wired)
|
||||
{
|
||||
register pt_entry_t *pte;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
PMAP_LOCK(pmap);
|
||||
pte = pmap_pte(pmap, va);
|
||||
|
||||
|
@ -950,8 +950,6 @@ pmap_extract(pmap_t pmap, vm_offset_t va)
|
||||
vm_paddr_t pa;
|
||||
|
||||
pa = 0;
|
||||
if (pmap == NULL)
|
||||
return (pa);
|
||||
PMAP_LOCK(pmap);
|
||||
oldpmap = pmap_install(pmap);
|
||||
pte = pmap_find_vhpt(va);
|
||||
@ -977,8 +975,6 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
|
||||
vm_page_t m;
|
||||
|
||||
m = NULL;
|
||||
if (pmap == NULL)
|
||||
return (m);
|
||||
vm_page_lock_queues();
|
||||
PMAP_LOCK(pmap);
|
||||
oldpmap = pmap_install(pmap);
|
||||
@ -1318,9 +1314,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
|
||||
pv_entry_t npv, pv;
|
||||
struct ia64_lpte *pte;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
if (pmap->pm_stats.resident_count == 0)
|
||||
return;
|
||||
|
||||
@ -1430,9 +1423,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot)
|
||||
pmap_t oldpmap;
|
||||
struct ia64_lpte *pte;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
if ((prot & VM_PROT_READ) == VM_PROT_NONE) {
|
||||
pmap_remove(pmap, sva, eva);
|
||||
return;
|
||||
@ -1506,9 +1496,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
|
||||
struct ia64_lpte *pte;
|
||||
boolean_t managed;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
vm_page_lock_queues();
|
||||
PMAP_LOCK(pmap);
|
||||
oldpmap = pmap_install(pmap);
|
||||
@ -1713,9 +1700,6 @@ pmap_change_wiring(pmap, va, wired)
|
||||
pmap_t oldpmap;
|
||||
struct ia64_lpte *pte;
|
||||
|
||||
if (pmap == NULL)
|
||||
return;
|
||||
|
||||
PMAP_LOCK(pmap);
|
||||
oldpmap = pmap_install(pmap);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user