FreeBSD/sys/arm/arm/pmap-v4.c
/*
 * Fetch pointers to the PDE/PTE for the given pmap/VA pair.
 * Returns TRUE if the mapping exists, else FALSE.
 *
 * NOTE: This function is only used by a couple of arm-specific modules.
 * It is not safe to take any pmap locks here, since we could be right
 * in the middle of debugging the pmap anyway...
 *
 * It is possible for this routine to return FALSE even though a valid
 * mapping does exist. This is because we don't lock, so the metadata
 * state may be inconsistent.
 *
 * NOTE: We can return a NULL *ptp in the case where the L1 pde is
 * a "section" mapping.
 */
Fetch pointers to the PDE/PTE for the given pmap/VA pair.
Returns TRUE if the mapping exists, else FALSE.

This function is only used by a couple of arm-specific modules.
It is not safe to take any pmap locks here, since we could be right
in the middle of debugging the pmap anyway

It is possible for this routine to return FALSE even though a valid
mapping does exist. This is because we don't lock, so the metadata
state may be inconsistent.

We can return a NULL *ptp in the case where the L1 pde is
a "section" mapping.
Fetch pointers to the PDE / PTE for the given pmap / VA pair . Returns TRUE if the mapping exists else FALSE . This function is only used by a couple of arm - specific modules . It is not safe to take any pmap locks here since we could be right in the middle of debugging the pmap anyway It is possible for this routine to return FALSE even though a valid mapping does exist . This is because we don ' t lock so the metadata state may be inconsistent . We can return a NULL * ptp in the case where the L1 pde is a " section " mapping .
boolean_t
pmap_get_pde_pte(pmap_t pm, vm_offset_t va, pd_entry_t **pdp, pt_entry_t **ptp)
{
	struct l2_dtable *l2;
	pd_entry_t *pl1pd, l1pd;
	pt_entry_t *ptep;
	u_short l1idx;
	if (pm->pm_l1 == NULL)
		return (FALSE);
	l1idx = L1_IDX(va);
	*pdp = pl1pd = &pm->pm_l1->l1_kva[l1idx];
	l1pd = *pl1pd;
	if (l1pte_section_p(l1pd)) {
		*ptp = NULL;
		return (TRUE);
	}
	if (pm->pm_l2 == NULL)
		return (FALSE);
	l2 = pm->pm_l2[L2_IDX(l1idx)];
	if (l2 == NULL ||
	    (ptep = l2->l2_bucket[L2_BUCKET(l1idx)].l2b_kva) == NULL) {
		return (FALSE);
	}
	*ptp = &ptep[l2pte_index(va)];
	return (TRUE);
}
boolean_t pmap_get_pde_pte ( pmap_t pm , vm_offset_t va , pd_entry_t * * pdp , pt_entry_t * * ptp ) { struct l2_dtable * l2 ; pd_entry_t * pl1pd , l1pd ; pt_entry_t * ptep ; u_short l1idx ; if ( pm -> pm_l1 == NULL ) return ( FALSE ) ; l1idx = L1_IDX ( va ) ; * pdp = pl1pd = & pm -> pm_l1 -> l1_kva [ l1idx ] ; l1pd = * pl1pd ; if ( l1pte_section_p ( l1pd ) ) { * ptp = NULL ; return ( TRUE ) ; } if ( pm -> pm_l2 == NULL ) return ( FALSE ) ; l2 = pm -> pm_l2 [ L2_IDX ( l1idx ) ] ; if ( l2 == NULL || ( ptep = l2 -> l2_bucket [ L2_BUCKET ( l1idx ) ] . l2b_kva ) == NULL ) { return ( FALSE ) ; } * ptp = & ptep [ l2pte_index ( va ) ] ; return ( TRUE ) ; }
Fetch pointers to the PDE/PTE for the given pmap/VA pair.
Fetch pointers to the PDE / PTE for the given pmap / VA pair .