Changes in kernel/arch/sparc64/src/mm/sun4v/as.c [e08162b:cd3b380] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/mm/sun4v/as.c
re08162b rcd3b380 66 66 { 67 67 #ifdef CONFIG_TSB 68 uintptr_t tsb_base = frame_alloc(TSB_FRAMES, flags, TSB_SIZE - 1); 69 if (!tsb_base) 68 uintptr_t tsb = 69 frame_alloc(SIZE2FRAMES(TSB_ENTRY_COUNT * sizeof(tsb_entry_t)), 70 flags, 0); 71 if (!tsb) 70 72 return -1; 71 72 tsb_entry_t *tsb = (tsb_entry_t *) PA2KA(tsb_base); 73 73 74 74 as->arch.tsb_description.page_size = PAGESIZE_8K; 75 75 as->arch.tsb_description.associativity = 1; 76 76 as->arch.tsb_description.num_ttes = TSB_ENTRY_COUNT; 77 77 as->arch.tsb_description.pgsize_mask = 1 << PAGESIZE_8K; 78 as->arch.tsb_description.tsb_base = tsb _base;78 as->arch.tsb_description.tsb_base = tsb; 79 79 as->arch.tsb_description.reserved = 0; 80 80 as->arch.tsb_description.context = 0; 81 81 82 memsetb(tsb, TSB_SIZE, 0); 82 memsetb((void *) PA2KA(as->arch.tsb_description.tsb_base), 83 TSB_ENTRY_COUNT * sizeof(tsb_entry_t), 0); 83 84 #endif 84 85 … … 89 90 { 90 91 #ifdef CONFIG_TSB 91 frame_free(as->arch.tsb_description.tsb_base, TSB_FRAMES); 92 size_t frames = SIZE2FRAMES(TSB_ENTRY_COUNT * sizeof(tsb_entry_t)); 93 frame_free(as->arch.tsb_description.tsb_base, frames); 92 94 93 return TSB_FRAMES;95 return frames; 94 96 #else 95 97 return 0; … … 124 126 uintptr_t tsb = PA2KA(as->arch.tsb_description.tsb_base); 125 127 126 if (!overlaps(tsb, TSB_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {128 if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) { 127 129 /* 128 130 * TSBs were allocated from memory not covered … … 135 137 } 136 138 137 __hypercall_fast2(MMU_TSB_CTXNON0, 1, KA2PA(& as->arch.tsb_description));139 __hypercall_fast2(MMU_TSB_CTXNON0, 1, KA2PA(&(as->arch.tsb_description))); 138 140 #endif 139 141 } … … 164 166 uintptr_t tsb = PA2KA(as->arch.tsb_description.tsb_base); 165 167 166 if (!overlaps(tsb, TSB_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {168 if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) { 167 169 /* 168 170 * TSBs were allocated from memory not covered
Note:
See TracChangeset
for help on using the changeset viewer.