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

Function pmap_enter_4mpage

freebsd/i386/i386/pmap.c:3904–3923  ·  view source on GitHub ↗

* Tries to create a read- and/or execute-only 2 or 4 MB page mapping. Returns * true if successful. Returns false if (1) a mapping already exists at the * specified virtual address or (2) a PV entry cannot be allocated without * reclaiming another PV entry. */

Source from the content-addressed store, hash-verified

3902 * reclaiming another PV entry.
3903 */
3904static bool
3905pmap_enter_4mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot)
3906{
3907 pd_entry_t newpde;
3908
3909 PMAP_LOCK_ASSERT(pmap, MA_OWNED);
3910 newpde = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(pmap, m->md.pat_mode, 1) |
3911 PG_PS | PG_V;
3912 if ((m->oflags & VPO_UNMANAGED) == 0)
3913 newpde |= PG_MANAGED;
3914#ifdef PMAP_PAE_COMP
3915 if ((prot & VM_PROT_EXECUTE) == 0 && !i386_read_exec)
3916 newpde |= pg_nx;
3917#endif
3918 if (pmap != kernel_pmap)
3919 newpde |= PG_U;
3920 return (pmap_enter_pde(pmap, va, newpde, PMAP_ENTER_NOSLEEP |
3921 PMAP_ENTER_NOREPLACE | PMAP_ENTER_NORECLAIM, NULL) ==
3922 KERN_SUCCESS);
3923}
3924
3925/*
3926 * Returns true if every page table entry in the page table page that maps

Callers 1

Calls 2

pmap_cache_bitsFunction · 0.70
pmap_enter_pdeFunction · 0.70

Tested by

no test coverage detected