* 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 *
| 917 | * Use XKPHYS for 64 bit, and KSEG0 where possible for 32 bit. |
| 918 | */ |
| 919 | vm_offset_t |
| 920 | pmap_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 |
no test coverage detected