Changes in kernel/arch/sparc64/src/mm/sun4u/as.c [cd3b380:e08162b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/mm/sun4u/as.c
rcd3b380 re08162b 63 63 { 64 64 #ifdef CONFIG_TSB 65 uintptr_t tsb_phys = 66 frame_alloc(SIZE2FRAMES((ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) * 67 sizeof(tsb_entry_t)), flags, 0); 68 if (!tsb_phys) 65 uintptr_t tsb_base = frame_alloc(TSB_FRAMES, flags, TSB_SIZE - 1); 66 if (!tsb_base) 69 67 return -1; 70 71 tsb_entry_t *tsb = (tsb_entry_t *) PA2KA(tsb_phys); 68 69 tsb_entry_t *tsb = (tsb_entry_t *) PA2KA(tsb_base); 70 memsetb(tsb, TSB_SIZE, 0); 72 71 73 72 as->arch.itsb = tsb; 74 73 as->arch.dtsb = tsb + ITSB_ENTRY_COUNT; 75 76 memsetb(as->arch.itsb, (ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) *77 sizeof(tsb_entry_t), 0);78 74 #endif 79 75 … … 84 80 { 85 81 #ifdef CONFIG_TSB 86 size_t frames = SIZE2FRAMES((ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) * 87 sizeof(tsb_entry_t)); 88 frame_free(KA2PA((uintptr_t) as->arch.itsb), frames); 89 90 return frames; 82 frame_free(KA2PA((uintptr_t) as->arch.itsb), TSB_FRAMES); 83 84 return TSB_FRAMES; 91 85 #else 92 86 return 0; … … 136 130 uintptr_t base = ALIGN_DOWN(config.base, 1 << KERNEL_PAGE_WIDTH); 137 131 138 ASSERT(as->arch.itsb && as->arch.dtsb); 132 ASSERT(as->arch.itsb); 133 ASSERT(as->arch.dtsb); 139 134 140 135 uintptr_t tsb = (uintptr_t) as->arch.itsb; 141 136 142 if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {137 if (!overlaps(tsb, TSB_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) { 143 138 /* 144 139 * TSBs were allocated from memory not covered … … 155 150 * 156 151 */ 157 tsb_base_reg_t tsb_base ;158 159 tsb_base .value = 0;160 tsb_base .size = TSB_SIZE;161 tsb_base .split = 0;162 163 tsb_base .base = ((uintptr_t) as->arch.itsb) >> MMU_PAGE_WIDTH;164 itsb_base_write(tsb_base .value);165 tsb_base .base = ((uintptr_t) as->arch.dtsb) >> MMU_PAGE_WIDTH;166 dtsb_base_write(tsb_base .value);152 tsb_base_reg_t tsb_base_reg; 153 154 tsb_base_reg.value = 0; 155 tsb_base_reg.size = TSB_BASE_REG_SIZE; 156 tsb_base_reg.split = 0; 157 158 tsb_base_reg.base = ((uintptr_t) as->arch.itsb) >> MMU_PAGE_WIDTH; 159 itsb_base_write(tsb_base_reg.value); 160 tsb_base_reg.base = ((uintptr_t) as->arch.dtsb) >> MMU_PAGE_WIDTH; 161 dtsb_base_write(tsb_base_reg.value); 167 162 168 163 #if defined (US3) … … 207 202 uintptr_t base = ALIGN_DOWN(config.base, 1 << KERNEL_PAGE_WIDTH); 208 203 209 ASSERT(as->arch.itsb && as->arch.dtsb); 204 ASSERT(as->arch.itsb); 205 ASSERT(as->arch.dtsb); 210 206 211 207 uintptr_t tsb = (uintptr_t) as->arch.itsb; 212 208 213 if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {209 if (!overlaps(tsb, TSB_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) { 214 210 /* 215 211 * TSBs were allocated from memory not covered
Note:
See TracChangeset
for help on using the changeset viewer.