FreeBSD/sys/arm/arm/pmap-v4.c
/*
 * this routine returns true if a physical page resides
 * in the given pmap.
 */
this routine returns true if a physical page resides
in the given pmap.
this routine returns true if a physical page resides in the given pmap .
boolean_t
pmap_page_exists_quick(pmap_t pmap, vm_page_t m)
{
	pv_entry_t pv;
	int loops = 0;
	boolean_t rv;
	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
	    ("pmap_page_exists_quick: page %p is not managed", m));
	rv = FALSE;
	rw_wlock(&pvh_global_lock);
	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
	    	if (pv->pv_pmap == pmap) {
			rv = TRUE;
			break;
	    	}
		loops++;
		if (loops >= 16)
			break;
	}
	rw_wunlock(&pvh_global_lock);
	return (rv);
}
boolean_t pmap_page_exists_quick ( pmap_t pmap , vm_page_t m ) { pv_entry_t pv ; int loops = 0 ; boolean_t rv ; KASSERT ( ( m -> oflags & VPO_UNMANAGED ) == 0 , ( " " , m ) ) ; rv = FALSE ; rw_wlock ( & pvh_global_lock ) ; TAILQ_FOREACH ( pv , & m -> md . pv_list , pv_list ) { if ( pv -> pv_pmap == pmap ) { rv = TRUE ; break ; } loops ++ ; if ( loops >= 16 ) break ; } rw_wunlock ( & pvh_global_lock ) ; return ( rv ) ; }
this routine returns true if a physical page resides
 in the given pmap.
this routine returns true if a physical page resides in the given pmap .