Changes in kernel/generic/src/mm/page.c [efb48eb:6645a14] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/page.c
refb48eb r6645a14 65 65 #include <arch/mm/asid.h> 66 66 #include <mm/as.h> 67 #include <mm/km.h>68 67 #include <mm/frame.h> 69 68 #include <arch/barrier.h> … … 76 75 #include <errno.h> 77 76 #include <align.h> 78 #include <macros.h>79 #include <bitops.h>80 77 81 78 /** Virtual operations for page subsystem. */ … … 180 177 } 181 178 182 /** Make the mapping shared by all page tables (not address spaces).183 *184 * @param base Starting virtual address of the range that is made global.185 * @param size Size of the address range that is made global.186 */187 void page_mapping_make_global(uintptr_t base, size_t size)188 {189 ASSERT(page_mapping_operations);190 ASSERT(page_mapping_operations->mapping_make_global);191 192 return page_mapping_operations->mapping_make_global(base, size);193 }194 195 uintptr_t hw_map(uintptr_t physaddr, size_t size)196 {197 uintptr_t virtaddr;198 size_t asize;199 size_t align;200 pfn_t i;201 202 asize = ALIGN_UP(size, PAGE_SIZE);203 align = ispwr2(size) ? size : (1U << (fnzb(size) + 1));204 virtaddr = km_page_alloc(asize, align);205 206 page_table_lock(AS_KERNEL, true);207 for (i = 0; i < ADDR2PFN(asize); i++) {208 uintptr_t addr = PFN2ADDR(i);209 page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr,210 PAGE_NOT_CACHEABLE | PAGE_WRITE);211 }212 page_table_unlock(AS_KERNEL, true);213 214 return virtaddr;215 }216 217 179 int page_find_mapping(uintptr_t virt, void **phys) 218 180 {
Note:
See TracChangeset
for help on using the changeset viewer.