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

Function pmap_enter_object

freebsd/mips/mips/pmap.c:2493–2514  ·  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

2491 * corresponding offset from m_start are mapped.
2492 */
2493void
2494pmap_enter_object(pmap_t pmap, vm_offset_t start, vm_offset_t end,
2495 vm_page_t m_start, vm_prot_t prot)
2496{
2497 vm_page_t m, mpte;
2498 vm_pindex_t diff, psize;
2499
2500 VM_OBJECT_ASSERT_LOCKED(m_start->object);
2501
2502 psize = atop(end - start);
2503 mpte = NULL;
2504 m = m_start;
2505 rw_wlock(&pvh_global_lock);
2506 PMAP_LOCK(pmap);
2507 while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) {
2508 mpte = pmap_enter_quick_locked(pmap, start + ptoa(diff), m,
2509 prot, mpte);
2510 m = TAILQ_NEXT(m, listq);
2511 }
2512 rw_wunlock(&pvh_global_lock);
2513 PMAP_UNLOCK(pmap);
2514}
2515
2516/*
2517 * pmap_object_init_pt preloads the ptes for a given object

Callers 1

vm_map_pmap_enterFunction · 0.50

Calls 1

pmap_enter_quick_lockedFunction · 0.70

Tested by

no test coverage detected