FreeBSD/sys/powerpc/aim/mmu_oea64.c
/*
 * Map a range of physical addresses into kernel virtual address space.
 *
 * The value passed in *virt is a suggested virtual address for the mapping.
 * Architectures which can support a direct-mapped physical to virtual region
 * can return the appropriate address within that region, leaving '*virt'
 * unchanged.  Other architectures should map the pages starting at '*virt' and
 * update '*virt' with the first usable address after the mapped region.
 */
Map a range of physical addresses into kernel virtual address space.
The value passed in *virt is a suggested virtual address for the mapping.
Architectures which can support a direct-mapped physical to virtual region
can return the appropriate address within that region, leaving '*virt'
unchanged.  Other architectures should map the pages starting at '*virt' and
update '*virt' with the first usable address after the mapped region.
Map a range of physical addresses into kernel virtual address space . The value passed in * virt is a suggested virtual address for the mapping . Architectures which can support a direct - mapped physical to virtual region can return the appropriate address within that region leaving ' * virt ' unchanged . Other architectures should map the pages starting at ' * virt ' and update ' * virt ' with the first usable address after the mapped region .
vm_offset_t
moea64_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t pa_start,
    vm_paddr_t pa_end, int prot)
{
	vm_offset_t	sva, va;
	if (hw_direct_map) {
		for (va = pa_start; va < pa_end; va += PAGE_SIZE)
			if (moea64_calc_wimg(va, VM_MEMATTR_DEFAULT) != LPTE_M)
				break;
		if (va == pa_end)
			return (pa_start);
	}
	sva = *virt;
	va = sva;
	for (; pa_start < pa_end; pa_start += PAGE_SIZE, va += PAGE_SIZE)
		moea64_kenter(mmu, va, pa_start);
	*virt = va;
	return (sva);
}
vm_offset_t moea64_map ( mmu_t mmu , vm_offset_t * virt , vm_paddr_t pa_start , vm_paddr_t pa_end , int prot ) { vm_offset_t sva , va ; if ( hw_direct_map ) { for ( va = pa_start ; va < pa_end ; va += PAGE_SIZE ) if ( moea64_calc_wimg ( va , VM_MEMATTR_DEFAULT ) != LPTE_M ) break ; if ( va == pa_end ) return ( pa_start ) ; } sva = * virt ; va = sva ; for ( ; pa_start < pa_end ; pa_start += PAGE_SIZE , va += PAGE_SIZE ) moea64_kenter ( mmu , va , pa_start ) ; * virt = va ; return ( sva ) ; }
Map a range of physical addresses into kernel virtual address space.
Map a range of physical addresses into kernel virtual address space .
/*
		 * Check if every page in the region is covered by the direct
		 * map. The direct map covers all of physical memory. Use
		 * moea64_calc_wimg() as a shortcut to see if the page is in
		 * physical memory as a way to see if the direct map covers it.
		 */ /* XXX respect prot argument */