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

Function pmap_remove_pte1_quick

freebsd/arm/arm/pmap-v6.c:4338–4371  ·  view source on GitHub ↗

* Just subroutine for pmap_remove_pages() to reasonably satisfy * good coding style, a.k.a. 80 character line width limit hell. */

Source from the content-addressed store, hash-verified

4336 * good coding style, a.k.a. 80 character line width limit hell.
4337 */
4338static __inline void
4339pmap_remove_pte1_quick(pmap_t pmap, pt1_entry_t pte1, pv_entry_t pv,
4340 struct spglist *free)
4341{
4342 vm_paddr_t pa;
4343 vm_page_t m, mt, mpt2pg;
4344 struct md_page *pvh;
4345
4346 pa = pte1_pa(pte1);
4347 m = PHYS_TO_VM_PAGE(pa);
4348
4349 KASSERT(m->phys_addr == pa, ("%s: vm_page_t %p addr mismatch %#x %#x",
4350 __func__, m, m->phys_addr, pa));
4351 KASSERT((m->flags & PG_FICTITIOUS) != 0 ||
4352 m < &vm_page_array[vm_page_array_size],
4353 ("%s: bad pte1 %#x", __func__, pte1));
4354
4355 if (pte1_is_dirty(pte1)) {
4356 for (mt = m; mt < &m[PTE1_SIZE / PAGE_SIZE]; mt++)
4357 vm_page_dirty(mt);
4358 }
4359
4360 pmap->pm_stats.resident_count -= PTE1_SIZE / PAGE_SIZE;
4361 pvh = pa_to_pvh(pa);
4362 TAILQ_REMOVE(&pvh->pv_list, pv, pv_next);
4363 if (TAILQ_EMPTY(&pvh->pv_list)) {
4364 for (mt = m; mt < &m[PTE1_SIZE / PAGE_SIZE]; mt++)
4365 if (TAILQ_EMPTY(&mt->md.pv_list))
4366 vm_page_aflag_clear(mt, PGA_WRITEABLE);
4367 }
4368 mpt2pg = pmap_pt2_page(pmap, pv->pv_va);
4369 if (mpt2pg != NULL)
4370 pmap_unwire_pt2_all(pmap, pv->pv_va, mpt2pg, free);
4371}
4372
4373/*
4374 * Just subroutine for pmap_remove_pages() to reasonably satisfy

Callers 1

pmap_remove_pagesFunction · 0.85

Calls 8

pte1_paFunction · 0.85
PHYS_TO_VM_PAGEFunction · 0.85
pte1_is_dirtyFunction · 0.85
vm_page_dirtyFunction · 0.85
pa_to_pvhFunction · 0.85
vm_page_aflag_clearFunction · 0.85
pmap_pt2_pageFunction · 0.85
pmap_unwire_pt2_allFunction · 0.85

Tested by

no test coverage detected