Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset ac11ac7 in mainline


Ignore:
Timestamp:
2010-06-28T19:05:39Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
7c31d20
Parents:
38e5675b
Message:

Switch mips32 to use the unified panic architecture. No stack traces so far.

Location:
kernel/arch/mips32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/include/exception.h

    r38e5675b rac11ac7  
    113113extern void exception_init(void);
    114114
     115extern void decode_istate(istate_t *);
     116
    115117#endif
    116118
  • kernel/arch/mips32/src/exception.c

    r38e5675b rac11ac7  
    7272};
    7373
    74 static void print_regdump(istate_t *istate)
    75 {
    76         printf("PC: %#x(%s) RA: %#x(%s), SP(%p)\n", istate->epc,
    77             symtab_fmt_name_lookup(istate->epc), istate->ra,
    78             symtab_fmt_name_lookup(istate->ra), istate->sp);
     74void decode_istate(istate_t *istate)
     75{
     76        printf("at=%p\tv0=%p\tv1=%p\n", istate->at, istate->v0, istate->v1);
     77        printf("a0=%p\ta1=%p\ta2=%p\n", istate->a0, istate->a1, istate->a2);
     78        printf("a3=%p\tt0=%p\tt1=%p\n", istate->a3, istate->t0, istate->t1);
     79        printf("t2=%p\tt3=%p\tt4=%p\n", istate->t2, istate->t3, istate->t4);
     80        printf("t5=%p\tt6=%p\tt7=%p\n", istate->t5, istate->t6, istate->t7);
     81        printf("t8=%p\tt9=%p\tgp=%p\n", istate->t8, istate->t9, istate->gp);
     82        printf("sp=%p\tra=%p\t\n", istate->sp, istate->ra);
     83        printf("lo=%p\thi=%p\t\n", istate->lo, istate->hi);
     84        printf("cp0_status=%p\tcp0_epc=%p\tk1=%p\n",
     85            istate->status, istate->epc, istate->k1);
    7986}
    8087
     
    8289{
    8390        fault_if_from_uspace(istate, "Unhandled exception %s.", exctable[n]);
    84        
    85         print_regdump(istate);
    86         panic("Unhandled exception %s.", exctable[n]);
     91        panic_badtrap(istate, n, "Unhandled exception %s.", exctable[n]);
    8792}
    8893
     
    125130                scheduler_fpu_lazy_request();
    126131        else {
    127                 fault_if_from_uspace(istate, "Unhandled Coprocessor Unusable Exception.");
    128                 panic("Unhandled Coprocessor Unusable Exception.");
     132                fault_if_from_uspace(istate,
     133                    "Unhandled Coprocessor Unusable Exception.");
     134                panic_badtrap(istate, n,
     135                    "Unhandled Coprocessor Unusable Exception.");
    129136        }
    130137}
     
    162169static void syscall_exception(unsigned int n, istate_t *istate)
    163170{
    164         panic("Syscall is handled through shortcut.");
     171        fault_if_from_uspace(istate, "Syscall is handled through shortcut.");
    165172}
    166173
  • kernel/arch/mips32/src/mm/tlb.c

    r38e5675b rac11ac7  
    321321void tlb_refill_fail(istate_t *istate)
    322322{
    323         const char *symbol = symtab_fmt_name_lookup(istate->epc);
    324         const char *sym2 = symtab_fmt_name_lookup(istate->ra);
    325        
    326         fault_if_from_uspace(istate, "TLB Refill Exception on %p.",
    327             cp0_badvaddr_read());
    328         panic("%x: TLB Refill Exception at %x (%s<-%s).", cp0_badvaddr_read(),
    329             istate->epc, symbol, sym2);
     323        uintptr_t va = cp0_badvaddr_read();
     324       
     325        fault_if_from_uspace(istate, "TLB Refill Exception on %p.", va);
     326        panic_memtrap(istate, PF_ACCESS_READ, va, "TLB Refill Exception.");
    330327}
    331328
     
    333330void tlb_invalid_fail(istate_t *istate)
    334331{
    335         const char *symbol = symtab_fmt_name_lookup(istate->epc);
    336        
    337         fault_if_from_uspace(istate, "TLB Invalid Exception on %p.",
    338             cp0_badvaddr_read());
    339         panic("%x: TLB Invalid Exception at %x (%s).", cp0_badvaddr_read(),
    340             istate->epc, symbol);
     332        uintptr_t va = cp0_badvaddr_read();
     333       
     334        fault_if_from_uspace(istate, "TLB Invalid Exception on %p.", va);
     335        panic_memtrap(istate, PF_ACCESS_READ, va, "TLB Invalid Exception.");
    341336}
    342337
    343338void tlb_modified_fail(istate_t *istate)
    344339{
    345         const char *symbol = symtab_fmt_name_lookup(istate->epc);
    346        
    347         fault_if_from_uspace(istate, "TLB Modified Exception on %p.",
    348             cp0_badvaddr_read());
    349         panic("%x: TLB Modified Exception at %x (%s).", cp0_badvaddr_read(),
    350             istate->epc, symbol);
     340        uintptr_t va = cp0_badvaddr_read();
     341       
     342        fault_if_from_uspace(istate, "TLB Modified Exception on %p.", va);
     343        panic_memtrap(istate, PF_ACCESS_WRITE, va, "TLB Modified Exception.");
    351344}
    352345
Note: See TracChangeset for help on using the changeset viewer.