Changeset e08162b in mainline for kernel/arch/sparc64/src/mm/sun4v/as.c
- Timestamp:
- 2016-01-07T13:41:38Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f4582c6
- Parents:
- 7254df6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/mm/sun4v/as.c
r7254df6 re08162b 66 66 { 67 67 #ifdef CONFIG_TSB 68 uintptr_t tsb = 69 frame_alloc(SIZE2FRAMES(TSB_ENTRY_COUNT * sizeof(tsb_entry_t)), 70 flags, 0); 71 if (!tsb) 68 uintptr_t tsb_base = frame_alloc(TSB_FRAMES, flags, TSB_SIZE - 1); 69 if (!tsb_base) 72 70 return -1; 73 71 72 tsb_entry_t *tsb = (tsb_entry_t *) PA2KA(tsb_base); 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 ;78 as->arch.tsb_description.tsb_base = tsb_base; 79 79 as->arch.tsb_description.reserved = 0; 80 80 as->arch.tsb_description.context = 0; 81 81 82 memsetb((void *) PA2KA(as->arch.tsb_description.tsb_base), 83 TSB_ENTRY_COUNT * sizeof(tsb_entry_t), 0); 82 memsetb(tsb, TSB_SIZE, 0); 84 83 #endif 85 84 … … 90 89 { 91 90 #ifdef CONFIG_TSB 92 size_t frames = SIZE2FRAMES(TSB_ENTRY_COUNT * sizeof(tsb_entry_t)); 93 frame_free(as->arch.tsb_description.tsb_base, frames); 91 frame_free(as->arch.tsb_description.tsb_base, TSB_FRAMES); 94 92 95 return frames;93 return TSB_FRAMES; 96 94 #else 97 95 return 0; … … 126 124 uintptr_t tsb = PA2KA(as->arch.tsb_description.tsb_base); 127 125 128 if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {126 if (!overlaps(tsb, TSB_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) { 129 127 /* 130 128 * TSBs were allocated from memory not covered … … 137 135 } 138 136 139 __hypercall_fast2(MMU_TSB_CTXNON0, 1, KA2PA(& (as->arch.tsb_description)));137 __hypercall_fast2(MMU_TSB_CTXNON0, 1, KA2PA(&as->arch.tsb_description)); 140 138 #endif 141 139 } … … 166 164 uintptr_t tsb = PA2KA(as->arch.tsb_description.tsb_base); 167 165 168 if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {166 if (!overlaps(tsb, TSB_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) { 169 167 /* 170 168 * TSBs were allocated from memory not covered
Note:
See TracChangeset
for help on using the changeset viewer.