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

Function pmap_enter_object

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

* Maps a sequence of resident pages belonging to the same object. * The sequence begins with the given page m_start. This page is * mapped at the given virtual address start. Each subsequent page is * mapped at a virtual address that is offset from start by the same * amount as the page is offset from m_start within the object. The * last page in the sequence is the page with the lar

Source from the content-addressed store, hash-verified

4803 * corresponding offset from m_start are mapped.
4804 */
4805void
4806pmap_enter_object(pmap_t pmap, vm_offset_t start, vm_offset_t end,
4807 vm_page_t m_start, vm_prot_t prot)
4808{
4809 vm_offset_t va;
4810 vm_page_t m, mpt2pg;
4811 vm_pindex_t diff, psize;
4812
4813 PDEBUG(6, printf("%s: pmap %p start %#x end %#x m %p prot %#x\n",
4814 __func__, pmap, start, end, m_start, prot));
4815
4816 VM_OBJECT_ASSERT_LOCKED(m_start->object);
4817 psize = atop(end - start);
4818 mpt2pg = NULL;
4819 m = m_start;
4820 rw_wlock(&pvh_global_lock);
4821 PMAP_LOCK(pmap);
4822 while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) {
4823 va = start + ptoa(diff);
4824 if ((va & PTE1_OFFSET) == 0 && va + PTE1_SIZE <= end &&
4825 m->psind == 1 && sp_enabled &&
4826 pmap_enter_1mpage(pmap, va, m, prot))
4827 m = &m[PTE1_SIZE / PAGE_SIZE - 1];
4828 else
4829 mpt2pg = pmap_enter_quick_locked(pmap, va, m, prot,
4830 mpt2pg);
4831 m = TAILQ_NEXT(m, listq);
4832 }
4833 rw_wunlock(&pvh_global_lock);
4834 PMAP_UNLOCK(pmap);
4835}
4836
4837/*
4838 * This code maps large physical mmap regions into the

Callers

nothing calls this directly

Calls 3

pmap_enter_1mpageFunction · 0.85
pmap_enter_quick_lockedFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected