FreeBSD/sys/i386/i386/pmap.c
/*
 *	Routine:	pmap_extract
 *	Function:
 *		Extract the physical page address associated
 *		with the given map/virtual_address pair.
 */
pmap_extract
Function:
Extract the physical page address associated
with the given map/virtual_address pair.
pmap_extract Function : Extract the physical page address associated with the given map / virtual_address pair .
vm_paddr_t 
pmap_extract(pmap_t pmap, vm_offset_t va)
{
	vm_paddr_t rtval;
	pt_entry_t *pte;
	pd_entry_t pde;
	rtval = 0;
	PMAP_LOCK(pmap);
	pde = pmap->pm_pdir[va >> PDRSHIFT];
	if (pde != 0) {
		if ((pde & PG_PS) != 0)
			rtval = (pde & PG_PS_FRAME) | (va & PDRMASK);
		else {
			pte = pmap_pte(pmap, va);
			rtval = (*pte & PG_FRAME) | (va & PAGE_MASK);
			pmap_pte_release(pte);
		}
	}
	PMAP_UNLOCK(pmap);
	return (rtval);
}
vm_paddr_t pmap_extract ( pmap_t pmap , vm_offset_t va ) { vm_paddr_t rtval ; pt_entry_t * pte ; pd_entry_t pde ; rtval = 0 ; PMAP_LOCK ( pmap ) ; pde = pmap -> pm_pdir [ va >> PDRSHIFT ] ; if ( pde != 0 ) { if ( ( pde & PG_PS ) != 0 ) rtval = ( pde & PG_PS_FRAME ) | ( va & PDRMASK ) ; else { pte = pmap_pte ( pmap , va ) ; rtval = ( * pte & PG_FRAME ) | ( va & PAGE_MASK ) ; pmap_pte_release ( pte ) ; } } PMAP_UNLOCK ( pmap ) ; return ( rtval ) ; }
Routine:        pmap_extract
      Function:
              Extract the physical page address associated
              with the given map/virtual_address pair.
Routine : pmap_extract Function : Extract the physical page address associated with the given map / virtual_address pair .