FreeBSD/sys/powerpc/aim/mmu_oea.c
/*
 * Returns true if the pmap's pv is one of the first
 * 16 pvs linked to from this page.  This count may
 * be changed upwards or downwards in the future; it
 * is only necessary that true be returned for a small
 * subset of pmaps for proper page aging.
 */
Returns true if the pmap's pv is one of the first
16 pvs linked to from this page.  This count may
be changed upwards or downwards in the future; it
is only necessary that true be returned for a small
subset of pmaps for proper page aging.
Returns true if the pmap ' s pv is one of the first 16 pvs linked to from this page . This count may be changed upwards or downwards in the future ; it is only necessary that true be returned for a small subset of pmaps for proper page aging .
boolean_t
moea_page_exists_quick(mmu_t mmu, pmap_t pmap, vm_page_t m)
{
        int loops;
	struct pvo_entry *pvo;
	boolean_t rv;
	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
	    ("moea_page_exists_quick: page %p is not managed", m));
	loops = 0;
	rv = FALSE;
	rw_wlock(&pvh_global_lock);
	LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) {
		if (pvo->pvo_pmap == pmap) {
			rv = TRUE;
			break;
		}
		if (++loops >= 16)
			break;
	}
	rw_wunlock(&pvh_global_lock);
	return (rv);
}
boolean_t moea_page_exists_quick ( mmu_t mmu , pmap_t pmap , vm_page_t m ) { int loops ; struct pvo_entry * pvo ; boolean_t rv ; KASSERT ( ( m -> oflags & VPO_UNMANAGED ) == 0 , ( " " , m ) ) ; loops = 0 ; rv = FALSE ; rw_wlock ( & pvh_global_lock ) ; LIST_FOREACH ( pvo , vm_page_to_pvoh ( m ) , pvo_vlink ) { if ( pvo -> pvo_pmap == pmap ) { rv = TRUE ; break ; } if ( ++ loops >= 16 ) break ; } rw_wunlock ( & pvh_global_lock ) ; return ( rv ) ; }
Returns true if the pmap's pv is one of the first
 16 pvs linked to from this page.
Returns true if the pmap ' s pv is one of the first 16 pvs linked to from this page .