Changes in kernel/arch/sparc64/src/mm/sun4u/tlb.c [560b81c:59fb782] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/mm/sun4u/tlb.c
r560b81c r59fb782 194 194 195 195 /** ITLB miss handler. */ 196 void fast_instruction_access_mmu_miss( unsigned int tt, istate_t *istate)196 void fast_instruction_access_mmu_miss(sysarg_t unused, istate_t *istate) 197 197 { 198 198 size_t index = (istate->tpc >> MMU_PAGE_WIDTH) % MMU_PAGES_PER_PAGE; 199 pte_t t; 200 201 bool found = page_mapping_find(AS, istate->tpc, true, &t); 202 if (found && PTE_EXECUTABLE(&t)) { 203 ASSERT(t.p); 204 199 pte_t *t; 200 201 t = page_mapping_find(AS, istate->tpc, true); 202 if (t && PTE_EXECUTABLE(t)) { 205 203 /* 206 204 * The mapping was found in the software page hash table. 207 205 * Insert it into ITLB. 208 206 */ 209 t .a = true;210 itlb_pte_copy( &t, index);207 t->a = true; 208 itlb_pte_copy(t, index); 211 209 #ifdef CONFIG_TSB 212 itsb_pte_copy(&t, index); 213 #endif 214 page_mapping_update(AS, istate->tpc, true, &t); 210 itsb_pte_copy(t, index); 211 #endif 215 212 } else { 216 213 /* … … 227 224 * low-level, assembly language part of the fast_data_access_mmu_miss handler. 228 225 * 229 * @param tt Trap type. 226 * @param tag Content of the TLB Tag Access register as it existed 227 * when the trap happened. This is to prevent confusion 228 * created by clobbered Tag Access register during a nested 229 * DTLB miss. 230 230 * @param istate Interrupted state saved on the stack. 231 231 */ 232 void fast_data_access_mmu_miss(unsigned int tt, istate_t *istate) 233 { 234 tlb_tag_access_reg_t tag; 232 void fast_data_access_mmu_miss(tlb_tag_access_reg_t tag, istate_t *istate) 233 { 235 234 uintptr_t page_8k; 236 235 uintptr_t page_16k; 237 236 size_t index; 238 pte_t t;237 pte_t *t; 239 238 as_t *as = AS; 240 239 241 tag.value = istate->tlb_tag_access;242 240 page_8k = (uint64_t) tag.vpn << MMU_PAGE_WIDTH; 243 241 page_16k = ALIGN_DOWN(page_8k, PAGE_SIZE); … … 256 254 } 257 255 258 bool found = page_mapping_find(as, page_16k, true, &t); 259 if (found) { 260 ASSERT(t.p); 261 256 t = page_mapping_find(as, page_16k, true); 257 if (t) { 262 258 /* 263 259 * The mapping was found in the software page hash table. 264 260 * Insert it into DTLB. 265 261 */ 266 t .a = true;267 dtlb_pte_copy( &t, index, true);262 t->a = true; 263 dtlb_pte_copy(t, index, true); 268 264 #ifdef CONFIG_TSB 269 dtsb_pte_copy(&t, index, true); 270 #endif 271 page_mapping_update(as, page_16k, true, &t); 265 dtsb_pte_copy(t, index, true); 266 #endif 272 267 } else { 273 268 /* … … 281 276 /** DTLB protection fault handler. 282 277 * 283 * @param tt Trap type. 278 * @param tag Content of the TLB Tag Access register as it existed 279 * when the trap happened. This is to prevent confusion 280 * created by clobbered Tag Access register during a nested 281 * DTLB miss. 284 282 * @param istate Interrupted state saved on the stack. 285 283 */ 286 void fast_data_access_protection(unsigned int tt, istate_t *istate) 287 { 288 tlb_tag_access_reg_t tag; 284 void fast_data_access_protection(tlb_tag_access_reg_t tag, istate_t *istate) 285 { 289 286 uintptr_t page_16k; 290 287 size_t index; 291 pte_t t;288 pte_t *t; 292 289 as_t *as = AS; 293 290 294 tag.value = istate->tlb_tag_access;295 291 page_16k = ALIGN_DOWN((uint64_t) tag.vpn << MMU_PAGE_WIDTH, PAGE_SIZE); 296 292 index = tag.vpn % MMU_PAGES_PER_PAGE; /* 16K-page emulation */ … … 299 295 as = AS_KERNEL; 300 296 301 bool found = page_mapping_find(as, page_16k, true, &t); 302 if (found && PTE_WRITABLE(&t)) { 303 ASSERT(t.p); 304 297 t = page_mapping_find(as, page_16k, true); 298 if (t && PTE_WRITABLE(t)) { 305 299 /* 306 300 * The mapping was found in the software page hash table and is … … 308 302 * into DTLB. 309 303 */ 310 t .a = true;311 t .d = true;304 t->a = true; 305 t->d = true; 312 306 dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_SECONDARY, 313 307 page_16k + index * MMU_PAGE_SIZE); 314 dtlb_pte_copy( &t, index, false);308 dtlb_pte_copy(t, index, false); 315 309 #ifdef CONFIG_TSB 316 dtsb_pte_copy(&t, index, false); 317 #endif 318 page_mapping_update(as, page_16k, true, &t); 310 dtsb_pte_copy(t, index, false); 311 #endif 319 312 } else { 320 313 /*
Note:
See TracChangeset
for help on using the changeset viewer.