Changeset a35b458 in mainline for kernel/arch/riscv64/src/mm
- Timestamp:
- 2018-03-02T20:10:49Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- Location:
- kernel/arch/riscv64/src/mm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/riscv64/src/mm/frame.c
r3061bc1 ra35b458 56 56 pfn_t minconf = 57 57 max3(ADDR2PFN(physmem_start), htif_frame + 1, pt_frame + 1); 58 58 59 59 for (size_t i = 0; i < memmap.cnt; i++) { 60 60 /* To be safe, make the available zone possibly smaller */ … … 63 63 size_t size = ALIGN_DOWN(memmap.zones[i].size - 64 64 (base - ((uintptr_t) memmap.zones[i].start)), FRAME_SIZE); 65 65 66 66 if (!frame_adjust_zone_bounds(low, &base, &size)) 67 67 return; 68 68 69 69 pfn_t pfn = ADDR2PFN(base); 70 70 size_t count = SIZE2FRAMES(size); 71 71 pfn_t conf; 72 72 73 73 if (low) { 74 74 if ((minconf < pfn) || (minconf >= pfn + count)) … … 76 76 else 77 77 conf = minconf; 78 78 79 79 zone_create(pfn, count, conf, 80 80 ZONE_AVAILABLE | ZONE_LOWMEM); … … 91 91 { 92 92 frame_common_arch_init(true); 93 93 94 94 frame_mark_unavailable(htif_frame, 1); 95 95 frame_mark_unavailable(pt_frame, 1); -
kernel/arch/riscv64/src/mm/page.c
r3061bc1 ra35b458 53 53 if (config.cpu_active == 1) { 54 54 page_mapping_operations = &pt_mapping_operations; 55 55 56 56 page_table_lock(AS_KERNEL, true); 57 57 58 58 /* 59 59 * PA2KA(identity) mapping for all low-memory frames. … … 64 64 page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, 65 65 PAGE_GLOBAL | PAGE_CACHEABLE | PAGE_EXEC | PAGE_WRITE | PAGE_READ); 66 66 67 67 page_table_unlock(AS_KERNEL, true); 68 68 69 69 // FIXME: register page fault extension handler 70 70 71 71 write_satp((uintptr_t) AS_KERNEL->genarch.page_table); 72 72 73 73 /* The boot page table is no longer needed. */ 74 74 // FIXME: frame_mark_available(pt_frame, 1); … … 84 84 uint64_t satp = ((ptl0 >> FRAME_WIDTH) & SATP_PFN_MASK) | 85 85 SATP_MODE_SV48; 86 86 87 87 asm volatile ( 88 88 "csrw sptbr, %[satp]\n"
Note:
See TracChangeset
for help on using the changeset viewer.
