Changeset 36f19c0 in mainline
- Timestamp:
- 2007-04-09T16:21:47Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ec5b3204
- Parents:
- 183788f1
- Location:
- kernel/arch/sparc64
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/mm/tlb.h
r183788f1 r36f19c0 429 429 } 430 430 431 extern void fast_instruction_access_mmu_miss( int n, istate_t *istate);432 extern void fast_data_access_mmu_miss( int n, istate_t *istate);433 extern void fast_data_access_protection( int n, istate_t *istate);431 extern void fast_instruction_access_mmu_miss(unative_t unused, istate_t *istate); 432 extern void fast_data_access_mmu_miss(tlb_tag_access_reg_t tag, istate_t *istate); 433 extern void fast_data_access_protection(tlb_tag_access_reg_t tag , istate_t *istate); 434 434 435 435 extern void dtlb_insert_mapping(uintptr_t page, uintptr_t frame, int pagesize, bool locked, bool cacheable); -
kernel/arch/sparc64/include/trap/mmu.h
r183788f1 r36f19c0 130 130 .endif 131 131 132 /* 133 * Switch from the MM globals. 134 */ 132 135 wrpr %g0, PSTATE_PRIV_BIT | PSTATE_AG_BIT, %pstate 136 137 /* 138 * Read the Tag Access register for the higher-level handler. 139 * This is necessary to survive nested DTLB misses. 140 */ 141 mov VA_DMMU_TAG_ACCESS, %g2 142 ldxa [%g2] ASI_DMMU, %g2 143 144 /* 145 * g2 will be passed as an argument to fast_data_access_mmu_miss(). 146 */ 133 147 PREEMPTIBLE_HANDLER fast_data_access_mmu_miss 134 148 .endm … … 143 157 .endif 144 158 159 /* 160 * Switch from the MM globals. 161 */ 145 162 wrpr %g0, PSTATE_PRIV_BIT | PSTATE_AG_BIT, %pstate 163 164 /* 165 * Read the Tag Access register for the higher-level handler. 166 * This is necessary to survive nested DTLB misses. 167 */ 168 mov VA_DMMU_TAG_ACCESS, %g2 169 ldxa [%g2] ASI_DMMU, %g2 170 171 /* 172 * g2 will be passed as an argument to fast_data_access_mmu_miss(). 173 */ 146 174 PREEMPTIBLE_HANDLER fast_data_access_protection 147 175 .endm -
kernel/arch/sparc64/src/mm/tlb.c
r183788f1 r36f19c0 199 199 200 200 /** ITLB miss handler. */ 201 void fast_instruction_access_mmu_miss( int n, istate_t *istate)201 void fast_instruction_access_mmu_miss(unative_t unused, istate_t *istate) 202 202 { 203 203 uintptr_t va = ALIGN_DOWN(istate->tpc, PAGE_SIZE); … … 235 235 * Note that some faults (e.g. kernel faults) were already resolved by the 236 236 * low-level, assembly language part of the fast_data_access_mmu_miss handler. 237 */ 238 void fast_data_access_mmu_miss(int n, istate_t *istate) 239 { 240 tlb_tag_access_reg_t tag; 237 * 238 * @param tag Content of the TLB Tag Access register as it existed when the 239 * trap happened. This is to prevent confusion created by clobbered 240 * Tag Access register during a nested DTLB miss. 241 * @param istate Interrupted state saved on the stack. 242 */ 243 void fast_data_access_mmu_miss(tlb_tag_access_reg_t tag, istate_t *istate) 244 { 241 245 uintptr_t va; 242 246 index_t index; 243 247 pte_t *t; 244 248 245 tag.value = dtlb_tag_access_read();246 249 va = ALIGN_DOWN((uint64_t) tag.vpn << MMU_PAGE_WIDTH, PAGE_SIZE); 247 250 index = tag.vpn % MMU_PAGES_PER_PAGE; … … 283 286 } 284 287 285 /** DTLB protection fault handler. */ 286 void fast_data_access_protection(int n, istate_t *istate) 287 { 288 tlb_tag_access_reg_t tag; 288 /** DTLB protection fault handler. 289 * 290 * @param tag Content of the TLB Tag Access register as it existed when the 291 * trap happened. This is to prevent confusion created by clobbered 292 * Tag Access register during a nested DTLB miss. 293 * @param istate Interrupted state saved on the stack. 294 */ 295 void fast_data_access_protection(tlb_tag_access_reg_t tag, istate_t *istate) 296 { 289 297 uintptr_t va; 290 298 index_t index; 291 299 pte_t *t; 292 300 293 tag.value = dtlb_tag_access_read();294 301 va = ALIGN_DOWN((uint64_t) tag.vpn << MMU_PAGE_WIDTH, PAGE_SIZE); 295 302 index = tag.vpn % MMU_PAGES_PER_PAGE; /* 16K-page emulation */ … … 372 379 373 380 va = tag.vpn << MMU_PAGE_WIDTH; 374 375 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, va, 376 tag.context); 381 if (tag.context) { 382 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, va, 383 tag.context); 384 } 377 385 dump_istate(istate); 378 386 printf("Faulting page: %p, ASID=%d\n", va, tag.context); … … 387 395 va = tag.vpn << MMU_PAGE_WIDTH; 388 396 389 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, va, 390 tag.context); 397 if (tag.context) { 398 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, va, 399 tag.context); 400 } 391 401 printf("Faulting page: %p, ASID=%d\n", va, tag.context); 392 402 dump_istate(istate);
Note:
See TracChangeset
for help on using the changeset viewer.