FreeBSD/sys/arm/arm/pmap-v6.c
/*
 *  Perform the pmap work for mincore.
 */
Perform the pmap work for mincore.
Perform the pmap work for mincore .
int
pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa)
{
	pt1_entry_t *pte1p, pte1;
	pt2_entry_t *pte2p, pte2;
	vm_paddr_t pa;
	boolean_t managed;
	int val;
	PMAP_LOCK(pmap);
retry:
	pte1p = pmap_pte1(pmap, addr);
	pte1 = pte1_load(pte1p);
	if (pte1_is_section(pte1)) {
		pa = trunc_page(pte1_pa(pte1) | (addr & PTE1_OFFSET));
		managed = pte1_is_managed(pte1);
		val = MINCORE_SUPER | MINCORE_INCORE;
		if (pte1_is_dirty(pte1))
			val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER;
		if (pte1 & PTE1_A)
			val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER;
	} else if (pte1_is_link(pte1)) {
		pte2p = pmap_pte2(pmap, addr);
		pte2 = pte2_load(pte2p);
		pmap_pte2_release(pte2p);
		pa = pte2_pa(pte2);
		managed = pte2_is_managed(pte2);
		val = MINCORE_INCORE;
		if (pte2_is_dirty(pte2))
			val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER;
		if (pte2 & PTE2_A)
			val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER;
	} else {
		managed = FALSE;
		val = 0;
	}
	if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) !=
	    (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && managed) {
		if (vm_page_pa_tryrelock(pmap, pa, locked_pa))
			goto retry;
	} else
		PA_UNLOCK_COND(*locked_pa);
	PMAP_UNLOCK(pmap);
	return (val);
}
int pmap_mincore ( pmap_t pmap , vm_offset_t addr , vm_paddr_t * locked_pa ) { pt1_entry_t * pte1p , pte1 ; pt2_entry_t * pte2p , pte2 ; vm_paddr_t pa ; boolean_t managed ; int val ; PMAP_LOCK ( pmap ) ; retry : pte1p = pmap_pte1 ( pmap , addr ) ; pte1 = pte1_load ( pte1p ) ; if ( pte1_is_section ( pte1 ) ) { pa = trunc_page ( pte1_pa ( pte1 ) | ( addr & PTE1_OFFSET ) ) ; managed = pte1_is_managed ( pte1 ) ; val = MINCORE_SUPER | MINCORE_INCORE ; if ( pte1_is_dirty ( pte1 ) ) val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER ; if ( pte1 & PTE1_A ) val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER ; } else if ( pte1_is_link ( pte1 ) ) { pte2p = pmap_pte2 ( pmap , addr ) ; pte2 = pte2_load ( pte2p ) ; pmap_pte2_release ( pte2p ) ; pa = pte2_pa ( pte2 ) ; managed = pte2_is_managed ( pte2 ) ; val = MINCORE_INCORE ; if ( pte2_is_dirty ( pte2 ) ) val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER ; if ( pte2 & PTE2_A ) val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER ; } else { managed = FALSE ; val = 0 ; } if ( ( val & ( MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER ) ) != ( MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER ) && managed ) { if ( vm_page_pa_tryrelock ( pmap , pa , locked_pa ) ) goto retry ; } else PA_UNLOCK_COND ( * locked_pa ) ; PMAP_UNLOCK ( pmap ) ; return ( val ) ; }
Perform the pmap work for mincore.
Perform the pmap work for mincore .
/* Ensure that "PHYS_TO_VM_PAGE(pa)->object" doesn't change. */