MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pmap_remove_page

Function pmap_remove_page

freebsd/mips/mips/pmap.c:1809–1834  ·  view source on GitHub ↗

* Remove a single page from a process address space */

Source from the content-addressed store, hash-verified

1807 * Remove a single page from a process address space
1808 */
1809static void
1810pmap_remove_page(struct pmap *pmap, vm_offset_t va)
1811{
1812 pd_entry_t *pde;
1813 pt_entry_t *ptq;
1814
1815 rw_assert(&pvh_global_lock, RA_WLOCKED);
1816 PMAP_LOCK_ASSERT(pmap, MA_OWNED);
1817 pde = pmap_pde(pmap, va);
1818 if (pde == NULL || *pde == 0)
1819 return;
1820 ptq = pmap_pde_to_pte(pde, va);
1821
1822 /*
1823 * If there is no pte for this address, just skip it!
1824 */
1825 if (!pte_test(ptq, PTE_V))
1826 return;
1827
1828 /*
1829 * Remove this PTE from the PT. If this is the last one, then
1830 * the TLB has already been shot down, so don't bother again
1831 */
1832 if (!pmap_remove_pte(pmap, ptq, va, *pde))
1833 pmap_invalidate_page(pmap, va);
1834}
1835
1836/*
1837 * Remove the given range of addresses from the specified map.

Callers 1

pmap_removeFunction · 0.70

Calls 4

pmap_pdeFunction · 0.70
pmap_pde_to_pteFunction · 0.70
pmap_remove_pteFunction · 0.70
pmap_invalidate_pageFunction · 0.70

Tested by

no test coverage detected