* 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
| 2491 | * corresponding offset from m_start are mapped. |
| 2492 | */ |
| 2493 | void |
| 2494 | pmap_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 |
no test coverage detected