FreeBSD/sys/arm/arm/pmap-v6.c
/*
 *  Extract from the kernel page table the physical address
 *  that is mapped by the given virtual address "va".
 */
Extract from the kernel page table the physical address
that is mapped by the given virtual address "va".
Extract from the kernel page table the physical address that is mapped by the given virtual address " va " .
vm_paddr_t
pmap_kextract(vm_offset_t va)
{
	vm_paddr_t pa;
	pt1_entry_t pte1;
	pt2_entry_t pte2;
	pte1 = pte1_load(kern_pte1(va));
	if (pte1_is_section(pte1)) {
		pa = pte1_pa(pte1) | (va & PTE1_OFFSET);
	} else if (pte1_is_link(pte1)) {
		pte2 = pte2_load(pt2map_entry(va));
		pa = pte2_pa(pte2) | (va & PTE2_OFFSET);
	}
	else {
		panic("%s: va %#x pte1 %#x", __func__, va, pte1);
	}
	return (pa);
}
vm_paddr_t pmap_kextract ( vm_offset_t va ) { vm_paddr_t pa ; pt1_entry_t pte1 ; pt2_entry_t pte2 ; pte1 = pte1_load ( kern_pte1 ( va ) ) ; if ( pte1_is_section ( pte1 ) ) { pa = pte1_pa ( pte1 ) | ( va & PTE1_OFFSET ) ; } else if ( pte1_is_link ( pte1 ) ) { pte2 = pte2_load ( pt2map_entry ( va ) ) ; pa = pte2_pa ( pte2 ) | ( va & PTE2_OFFSET ) ; } else { panic ( " " , __func__ , va , pte1 ) ; } return ( pa ) ; }
Extract from the kernel page table the physical address
  that is mapped by the given virtual address "va".
Extract from the kernel page table the physical address that is mapped by the given virtual address " va " .
/*
		 * We should beware of concurrent promotion that changes
		 * pte1 at this point. However, it's not a problem as PT2
		 * page is preserved by promotion in PT2TAB. So even if
		 * it happens, using of PT2MAP is still safe.
		 *
		 * QQQ: However, concurrent removing is a problem which
		 *      ends in abort on PT2MAP space. Locking must be used
		 *      to deal with this.
		 */