FreeBSD/sys/arm/arm/pmap-v6.c
/*
 *  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 offset from
 *  m_start that can be mapped at a virtual address less than the given
 *  virtual address end.  Not every virtual page between start and end
 *  is mapped; only those for which a resident page exists with the
 *  corresponding offset from m_start are mapped.
 */
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 offset from
m_start that can be mapped at a virtual address less than the given
virtual address end.  Not every virtual page between start and end
is mapped; only those for which a resident page exists with the
corresponding offset from m_start are mapped.
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 offset from m_start that can be mapped at a virtual address less than the given virtual address end . Not every virtual page between start and end is mapped ; only those for which a resident page exists with the corresponding offset from m_start are mapped .
void
pmap_enter_object(pmap_t pmap, vm_offset_t start, vm_offset_t end,
    vm_page_t m_start, vm_prot_t prot)
{
	vm_offset_t va;
	vm_page_t m, mpt2pg;
	vm_pindex_t diff, psize;
	PDEBUG(6, printf("%s: pmap %p start %#x end  %#x m %p prot %#x\n",
	    __func__, pmap, start, end, m_start, prot));
	VM_OBJECT_ASSERT_LOCKED(m_start->object);
	psize = atop(end - start);
	mpt2pg = NULL;
	m = m_start;
	rw_wlock(&pvh_global_lock);
	PMAP_LOCK(pmap);
	while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) {
		va = start + ptoa(diff);
		if ((va & PTE1_OFFSET) == 0 && va + PTE1_SIZE <= end &&
		    m->psind == 1 && sp_enabled &&
		    pmap_enter_pte1(pmap, va, m, prot))
			m = &m[PTE1_SIZE / PAGE_SIZE - 1];
		else
			mpt2pg = pmap_enter_quick_locked(pmap, va, m, prot,
			    mpt2pg);
		m = TAILQ_NEXT(m, listq);
	}
	rw_wunlock(&pvh_global_lock);
	PMAP_UNLOCK(pmap);
}
void pmap_enter_object ( pmap_t pmap , vm_offset_t start , vm_offset_t end , vm_page_t m_start , vm_prot_t prot ) { vm_offset_t va ; vm_page_t m , mpt2pg ; vm_pindex_t diff , psize ; PDEBUG ( 6 , printf ( " \n " , __func__ , pmap , start , end , m_start , prot ) ) ; VM_OBJECT_ASSERT_LOCKED ( m_start -> object ) ; psize = atop ( end - start ) ; mpt2pg = NULL ; m = m_start ; rw_wlock ( & pvh_global_lock ) ; PMAP_LOCK ( pmap ) ; while ( m != NULL && ( diff = m -> pindex - m_start -> pindex ) < psize ) { va = start + ptoa ( diff ) ; if ( ( va & PTE1_OFFSET ) == 0 && va + PTE1_SIZE <= end && m -> psind == 1 && sp_enabled && pmap_enter_pte1 ( pmap , va , m , prot ) ) m = & m [ PTE1_SIZE / PAGE_SIZE - 1 ] ; else mpt2pg = pmap_enter_quick_locked ( pmap , va , m , prot , mpt2pg ) ; m = TAILQ_NEXT ( m , listq ) ; } rw_wunlock ( & pvh_global_lock ) ; PMAP_UNLOCK ( pmap ) ; }
Maps a sequence of resident pages belonging to the same object.
Maps a sequence of resident pages belonging to the same object .