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

Function pmap_enter_object

freebsd/arm64/arm64/pmap.c:4378–4408  ·  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 largest o

Source from the content-addressed store, hash-verified

4376 * corresponding offset from m_start are mapped.
4377 */
4378void
4379pmap_enter_object(pmap_t pmap, vm_offset_t start, vm_offset_t end,
4380 vm_page_t m_start, vm_prot_t prot)
4381{
4382 struct rwlock *lock;
4383 vm_offset_t va;
4384 vm_page_t m, mpte;
4385 vm_pindex_t diff, psize;
4386
4387 VM_OBJECT_ASSERT_LOCKED(m_start->object);
4388
4389 psize = atop(end - start);
4390 mpte = NULL;
4391 m = m_start;
4392 lock = NULL;
4393 PMAP_LOCK(pmap);
4394 while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) {
4395 va = start + ptoa(diff);
4396 if ((va & L2_OFFSET) == 0 && va + L2_SIZE <= end &&
4397 m->psind == 1 && pmap_ps_enabled(pmap) &&
4398 pmap_enter_2mpage(pmap, va, m, prot, &lock))
4399 m = &m[L2_SIZE / PAGE_SIZE - 1];
4400 else
4401 mpte = pmap_enter_quick_locked(pmap, va, m, prot, mpte,
4402 &lock);
4403 m = TAILQ_NEXT(m, listq);
4404 }
4405 if (lock != NULL)
4406 rw_wunlock(lock);
4407 PMAP_UNLOCK(pmap);
4408}
4409
4410/*
4411 * this code makes some *MAJOR* assumptions:

Callers

nothing calls this directly

Calls 3

pmap_ps_enabledFunction · 0.70
pmap_enter_2mpageFunction · 0.70
pmap_enter_quick_lockedFunction · 0.70

Tested by

no test coverage detected