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