Changeset e16e0d59 in mainline for kernel/arch/mips32/src/mm/tlb.c


Ignore:
Timestamp:
2009-03-17T20:33:18Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5eb90cb
Parents:
b1c8dc0
Message:

Make optionality of symbol information less intrusive per Jakub's request. Also, improve symtab function names and update their semantics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/src/mm/tlb.c

    rb1c8dc0 re16e0d59  
    4646#include <align.h>
    4747#include <interrupt.h>
    48 
    49 #ifdef CONFIG_SYMTAB
    5048#include <symtab.h>
    51 #endif
    5249
    5350static void tlb_refill_fail(istate_t *);
     
    324321void tlb_refill_fail(istate_t *istate)
    325322{
    326         char *symbol = "";
    327         char *sym2 = "";
    328 
    329 #ifdef CONFIG_SYMTAB
    330         char *s = get_symtab_entry(istate->epc);
    331         if (s)
    332                 symbol = s;
    333         s = get_symtab_entry(istate->ra);
    334         if (s)
    335                 sym2 = s;
    336 #endif
    337 
     323        char *symbol, *sym2;
     324
     325        symbol = symtab_fmt_name_lookup(istate->epc);
     326        sym2 = symtab_fmt_name_lookup(istate->ra);
     327       
    338328        fault_if_from_uspace(istate, "TLB Refill Exception on %p.",
    339329            cp0_badvaddr_read());
    340         panic("%x: TLB Refill Exception at %x(%s<-%s).", cp0_badvaddr_read(),
     330        panic("%x: TLB Refill Exception at %x (%s<-%s).", cp0_badvaddr_read(),
    341331            istate->epc, symbol, sym2);
    342332}
     
    345335void tlb_invalid_fail(istate_t *istate)
    346336{
    347         char *symbol = "";
    348 
    349 #ifdef CONFIG_SYMTAB
    350         char *s = get_symtab_entry(istate->epc);
    351         if (s)
    352                 symbol = s;
    353 #endif
     337        char *symbol;
     338
     339        symbol = symtab_fmt_name_lookup(istate->epc);
    354340
    355341        fault_if_from_uspace(istate, "TLB Invalid Exception on %p.",
    356342            cp0_badvaddr_read());
    357         panic("%x: TLB Invalid Exception at %x(%s).", cp0_badvaddr_read(),
     343        panic("%x: TLB Invalid Exception at %x (%s).", cp0_badvaddr_read(),
    358344            istate->epc, symbol);
    359345}
     
    361347void tlb_modified_fail(istate_t *istate)
    362348{
    363         char *symbol = "";
    364 
    365 #ifdef CONFIG_SYMTAB
    366         char *s = get_symtab_entry(istate->epc);
    367         if (s)
    368                 symbol = s;
    369 #endif
     349        char *symbol;
     350
     351        symbol = symtab_fmt_name_lookup(istate->epc);
    370352
    371353        fault_if_from_uspace(istate, "TLB Modified Exception on %p.",
    372354            cp0_badvaddr_read());
    373         panic("%x: TLB Modified Exception at %x(%s).", cp0_badvaddr_read(),
     355        panic("%x: TLB Modified Exception at %x (%s).", cp0_badvaddr_read(),
    374356            istate->epc, symbol);
    375357}
Note: See TracChangeset for help on using the changeset viewer.