* Remove a single page from a process address space */
| 1807 | * Remove a single page from a process address space |
| 1808 | */ |
| 1809 | static void |
| 1810 | pmap_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. |
no test coverage detected