MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pmap_map

Function pmap_map

freebsd/mips/mips/pmap.c:919–935  ·  view source on GitHub ↗

* Used to 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 *

Source from the content-addressed store, hash-verified

917 * Use XKPHYS for 64 bit, and KSEG0 where possible for 32 bit.
918 */
919vm_offset_t
920pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot)
921{
922 vm_offset_t va, sva;
923
924 if (MIPS_DIRECT_MAPPABLE(end - 1))
925 return (MIPS_PHYS_TO_DIRECT(start));
926
927 va = sva = *virt;
928 while (start < end) {
929 pmap_kenter(va, start);
930 va += PAGE_SIZE;
931 start += PAGE_SIZE;
932 }
933 *virt = va;
934 return (sva);
935}
936
937/*
938 * Add a list of wired pages to the kva

Callers 4

vm_page_array_allocFunction · 0.50
vm_page_startupFunction · 0.50
vm_reserv_startupFunction · 0.50
startup_allocFunction · 0.50

Calls 1

pmap_kenterFunction · 0.70

Tested by

no test coverage detected