FreeBSD/sys/arm/arm/pmap-v6.c
/*
 *  Returns TRUE if any of the given mappings were referenced and FALSE
 *  otherwise. Both page and 1mpage mappings are supported.
 */
Returns TRUE if any of the given mappings were referenced and FALSE
otherwise. Both page and 1mpage mappings are supported.
Returns TRUE if any of the given mappings were referenced and FALSE otherwise . Both page and 1mpage mappings are supported .
static boolean_t
pmap_is_referenced_pvh(struct md_page *pvh)
{
	pv_entry_t pv;
	pt1_entry_t pte1;
	pt2_entry_t pte2;
	pmap_t pmap;
	boolean_t rv;
	rw_assert(&pvh_global_lock, RA_WLOCKED);
	rv = FALSE;
	sched_pin();
	TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) {
		pmap = PV_PMAP(pv);
		PMAP_LOCK(pmap);
		pte1 = pte1_load(pmap_pte1(pmap, pv->pv_va));
		if (pte1_is_section(pte1)) {
			rv = (pte1 & (PTE1_A | PTE1_V)) == (PTE1_A | PTE1_V);
		} else {
			pte2 = pte2_load(pmap_pte2_quick(pmap, pv->pv_va));
			rv = (pte2 & (PTE2_A | PTE2_V)) == (PTE2_A | PTE2_V);
		}
		PMAP_UNLOCK(pmap);
		if (rv)
			break;
	}
	sched_unpin();
	return (rv);
}
static boolean_t pmap_is_referenced_pvh ( struct md_page * pvh ) { pv_entry_t pv ; pt1_entry_t pte1 ; pt2_entry_t pte2 ; pmap_t pmap ; boolean_t rv ; rw_assert ( & pvh_global_lock , RA_WLOCKED ) ; rv = FALSE ; sched_pin ( ) ; TAILQ_FOREACH ( pv , & pvh -> pv_list , pv_next ) { pmap = PV_PMAP ( pv ) ; PMAP_LOCK ( pmap ) ; pte1 = pte1_load ( pmap_pte1 ( pmap , pv -> pv_va ) ) ; if ( pte1_is_section ( pte1 ) ) { rv = ( pte1 & ( PTE1_A | PTE1_V ) ) == ( PTE1_A | PTE1_V ) ; } else { pte2 = pte2_load ( pmap_pte2_quick ( pmap , pv -> pv_va ) ) ; rv = ( pte2 & ( PTE2_A | PTE2_V ) ) == ( PTE2_A | PTE2_V ) ; } PMAP_UNLOCK ( pmap ) ; if ( rv ) break ; } sched_unpin ( ) ; return ( rv ) ; }
Returns TRUE if any of the given mappings were referenced and FALSE
  otherwise.
Returns TRUE if any of the given mappings were referenced and FALSE otherwise .