Rev 1870 | Rev 1891 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1870 | Rev 1880 | ||
---|---|---|---|
Line 45... | Line 45... | ||
45 | #include <print.h> |
45 | #include <print.h> |
46 | #include <arch/types.h> |
46 | #include <arch/types.h> |
47 | #include <typedefs.h> |
47 | #include <typedefs.h> |
48 | #include <config.h> |
48 | #include <config.h> |
49 | #include <arch/trap/trap.h> |
49 | #include <arch/trap/trap.h> |
- | 50 | #include <arch/trap/exception.h> |
|
50 | #include <panic.h> |
51 | #include <panic.h> |
51 | #include <arch/asm.h> |
52 | #include <arch/asm.h> |
52 | #include <symtab.h> |
- | |
53 | 53 | ||
54 | static void dtlb_pte_copy(pte_t *t, bool ro); |
54 | static void dtlb_pte_copy(pte_t *t, bool ro); |
55 | static void itlb_pte_copy(pte_t *t); |
55 | static void itlb_pte_copy(pte_t *t); |
56 | static void do_fast_instruction_access_mmu_miss_fault(istate_t *istate, const char *str); |
56 | static void do_fast_instruction_access_mmu_miss_fault(istate_t *istate, const char *str); |
57 | static void do_fast_data_access_mmu_miss_fault(istate_t *istate, tlb_tag_access_reg_t tag, const char *str); |
57 | static void do_fast_data_access_mmu_miss_fault(istate_t *istate, tlb_tag_access_reg_t tag, const char *str); |
Line 305... | Line 305... | ||
305 | 305 | ||
306 | } |
306 | } |
307 | 307 | ||
308 | void do_fast_instruction_access_mmu_miss_fault(istate_t *istate, const char *str) |
308 | void do_fast_instruction_access_mmu_miss_fault(istate_t *istate, const char *str) |
309 | { |
309 | { |
310 | char *tpc_str = get_symtab_entry(istate->tpc); |
- | |
311 | - | ||
312 | fault_if_from_uspace(istate, "%s\n", str); |
310 | fault_if_from_uspace(istate, "%s\n", str); |
313 | printf("TPC=%p, (%s)\n", istate->tpc, tpc_str); |
311 | dump_istate(istate); |
314 | panic("%s\n", str); |
312 | panic("%s\n", str); |
315 | } |
313 | } |
316 | 314 | ||
317 | void do_fast_data_access_mmu_miss_fault(istate_t *istate, tlb_tag_access_reg_t tag, const char *str) |
315 | void do_fast_data_access_mmu_miss_fault(istate_t *istate, tlb_tag_access_reg_t tag, const char *str) |
318 | { |
316 | { |
319 | uintptr_t va; |
317 | uintptr_t va; |
320 | char *tpc_str = get_symtab_entry(istate->tpc); |
- | |
321 | 318 | ||
322 | va = tag.vpn << PAGE_WIDTH; |
319 | va = tag.vpn << PAGE_WIDTH; |
323 | 320 | ||
324 | fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, va, tag.context); |
321 | fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, va, tag.context); |
- | 322 | dump_istate(istate); |
|
325 | printf("Faulting page: %p, ASID=%d\n", va, tag.context); |
323 | printf("Faulting page: %p, ASID=%d\n", va, tag.context); |
326 | printf("TPC=%p, (%s)\n", istate->tpc, tpc_str); |
- | |
327 | panic("%s\n", str); |
324 | panic("%s\n", str); |
328 | } |
325 | } |
329 | 326 | ||
330 | void do_fast_data_access_protection_fault(istate_t *istate, tlb_tag_access_reg_t tag, const char *str) |
327 | void do_fast_data_access_protection_fault(istate_t *istate, tlb_tag_access_reg_t tag, const char *str) |
331 | { |
328 | { |
332 | uintptr_t va; |
329 | uintptr_t va; |
333 | char *tpc_str = get_symtab_entry(istate->tpc); |
- | |
334 | 330 | ||
335 | va = tag.vpn << PAGE_WIDTH; |
331 | va = tag.vpn << PAGE_WIDTH; |
336 | 332 | ||
337 | fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, va, tag.context); |
333 | fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, va, tag.context); |
338 | printf("Faulting page: %p, ASID=%d\n", va, tag.context); |
334 | printf("Faulting page: %p, ASID=%d\n", va, tag.context); |
339 | printf("TPC=%p, (%s)\n", istate->tpc, tpc_str); |
335 | dump_istate(istate); |
340 | panic("%s\n", str); |
336 | panic("%s\n", str); |
341 | } |
337 | } |
342 | 338 | ||
343 | /** Invalidate all unlocked ITLB and DTLB entries. */ |
339 | /** Invalidate all unlocked ITLB and DTLB entries. */ |
344 | void tlb_invalidate_all(void) |
340 | void tlb_invalidate_all(void) |