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

Function pmap_pv_insert_pde

freebsd/amd64/amd64/pmap.c:5562–5582  ·  view source on GitHub ↗

* Create the PV entry for a 2MB page mapping. Always returns true unless the * flag PMAP_ENTER_NORECLAIM is specified. If that flag is specified, returns * false if the PV entry cannot be allocated without resorting to reclamation. */

Source from the content-addressed store, hash-verified

5560 * false if the PV entry cannot be allocated without resorting to reclamation.
5561 */
5562static bool
5563pmap_pv_insert_pde(pmap_t pmap, vm_offset_t va, pd_entry_t pde, u_int flags,
5564 struct rwlock **lockp)
5565{
5566 struct md_page *pvh;
5567 pv_entry_t pv;
5568 vm_paddr_t pa;
5569
5570 PMAP_LOCK_ASSERT(pmap, MA_OWNED);
5571 /* Pass NULL instead of the lock pointer to disable reclamation. */
5572 if ((pv = get_pv_entry(pmap, (flags & PMAP_ENTER_NORECLAIM) != 0 ?
5573 NULL : lockp)) == NULL)
5574 return (false);
5575 pv->pv_va = va;
5576 pa = pde & PG_PS_FRAME;
5577 CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa);
5578 pvh = pa_to_pvh(pa);
5579 TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next);
5580 pvh->pv_gen++;
5581 return (true);
5582}
5583
5584/*
5585 * Fills a page table page with mappings to consecutive physical pages.

Callers 2

pmap_enter_pdeFunction · 0.70
pmap_copyFunction · 0.70

Calls 2

pa_to_pvhFunction · 0.85
get_pv_entryFunction · 0.70

Tested by

no test coverage detected