FreeBSD/sys/arm/arm/pmap-v6.c
/*
 *  Returns TRUE if any of the given mappings were used to modify
 *  physical memory.  Otherwise, returns FALSE.  Both page and 1mpage
 *  mappings are supported.
 */
Returns TRUE if any of the given mappings were used to modify
physical memory.  Otherwise, returns FALSE.  Both page and 1mpage
mappings are supported.
Returns TRUE if any of the given mappings were used to modify physical memory . Otherwise returns FALSE . Both page and 1mpage mappings are supported .
static boolean_t
pmap_is_modified_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_is_dirty(pte1);
		} else {
			KASSERT(pte1_is_link(pte1),
			    ("%s: pte1 %#x is not link", __func__, pte1));
			pte2 = pte2_load(pmap_pte2_quick(pmap, pv->pv_va));
			rv = pte2_is_dirty(pte2);
		}
		PMAP_UNLOCK(pmap);
		if (rv)
			break;
	}
	sched_unpin();
	return (rv);
}
static boolean_t pmap_is_modified_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_is_dirty ( pte1 ) ; } else { KASSERT ( pte1_is_link ( pte1 ) , ( " " , __func__ , pte1 ) ) ; pte2 = pte2_load ( pmap_pte2_quick ( pmap , pv -> pv_va ) ) ; rv = pte2_is_dirty ( pte2 ) ; } PMAP_UNLOCK ( pmap ) ; if ( rv ) break ; } sched_unpin ( ) ; return ( rv ) ; }
Returns TRUE if any of the given mappings were used to modify
  physical memory.
Returns TRUE if any of the given mappings were used to modify physical memory .