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

Function pmap_qenter

freebsd/amd64/amd64/pmap.c:3850–3873  ·  view source on GitHub ↗

* Add a list of wired pages to the kva * this routine is only used for temporary * kernel mappings that do not need to have * page modification or references recorded. * Note that old mappings are simply written * over. The page *must* be wired. * Note: SMP coherent. Uses a ranged shootdown IPI. */

Source from the content-addressed store, hash-verified

3848 * Note: SMP coherent. Uses a ranged shootdown IPI.
3849 */
3850void
3851pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count)
3852{
3853 pt_entry_t *endpte, oldpte, pa, *pte;
3854 vm_page_t m;
3855 int cache_bits;
3856
3857 oldpte = 0;
3858 pte = vtopte(sva);
3859 endpte = pte + count;
3860 while (pte < endpte) {
3861 m = *ma++;
3862 cache_bits = pmap_cache_bits(kernel_pmap, m->md.pat_mode, 0);
3863 pa = VM_PAGE_TO_PHYS(m) | cache_bits;
3864 if ((*pte & (PG_FRAME | X86_PG_PTE_CACHE)) != pa) {
3865 oldpte |= *pte;
3866 pte_store(pte, pa | pg_g | pg_nx | X86_PG_RW | X86_PG_V);
3867 }
3868 pte++;
3869 }
3870 if (__predict_false((oldpte & X86_PG_V) != 0))
3871 pmap_invalidate_range(kernel_pmap, sva, sva + count *
3872 PAGE_SIZE);
3873}
3874
3875/*
3876 * This routine tears out page mappings from the

Callers 3

pmap_init_pv_tableFunction · 0.70
pmap_map_io_transientFunction · 0.70
mp_realloc_pcpuFunction · 0.70

Calls 3

vtopteFunction · 0.85
pmap_cache_bitsFunction · 0.70
pmap_invalidate_rangeFunction · 0.70

Tested by

no test coverage detected