Changeset a000878c in mainline for kernel/arch/mips32/src


Ignore:
Timestamp:
2010-02-25T19:11:25Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
958de16
Parents:
a634485
Message:

make sure that all statically allocated strings are declared as "const char *"
and are treated as read-only

Location:
kernel/arch/mips32/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/src/cpu/cpu.c

    ra634485 ra000878c  
    4040
    4141struct data_t {
    42         char *vendor;
    43         char *model;
     42        const char *vendor;
     43        const char *model;
    4444};
    4545
  • kernel/arch/mips32/src/debugger.c

    ra634485 ra000878c  
    253253{
    254254        unsigned int i;
    255         char *symbol;
    256255       
    257256        printf("#  Count Address    INPROG ONESHOT FUNCCALL In symbol\n");
    258257        printf("-- ----- ---------- ------ ------- -------- ---------\n");
    259258       
    260         for (i = 0; i < BKPOINTS_MAX; i++)
     259        for (i = 0; i < BKPOINTS_MAX; i++) {
    261260                if (breakpoints[i].address) {
    262                         symbol = symtab_fmt_name_lookup(
     261                        const char *symbol = symtab_fmt_name_lookup(
    263262                            breakpoints[i].address);
    264 
     263                       
    265264                        printf("%-2u %-5d %#10zx %-6s %-7s %-8s %s\n", i,
    266265                            breakpoints[i].counter, breakpoints[i].address,
     
    270269                            BKPOINT_FUNCCALL) ? "true" : "false"), symbol);
    271270                }
     271        }
     272       
    272273        return 1;
    273274}
  • kernel/arch/mips32/src/exception.c

    ra634485 ra000878c  
    4949#include <symtab.h>
    5050
    51 static char * exctable[] = {
     51static const char *exctable[] = {
    5252        "Interrupt",
    5353        "TLB Modified",
     
    7474static void print_regdump(istate_t *istate)
    7575{
    76         char *pcsymbol, *rasymbol;
    77 
    78         pcsymbol = symtab_fmt_name_lookup(istate->epc);
    79         rasymbol = symtab_fmt_name_lookup(istate->ra);
    80 
     76        const char *pcsymbol = symtab_fmt_name_lookup(istate->epc);
     77        const char *rasymbol = symtab_fmt_name_lookup(istate->ra);
     78       
    8179        printf("PC: %#x(%s) RA: %#x(%s), SP(%p)\n", istate->epc, pcsymbol,
    8280            istate->ra, rasymbol, istate->sp);
     
    9391static void reserved_instr_exception(int n, istate_t *istate)
    9492{
    95         if (*((uint32_t *)istate->epc) == 0x7c03e83b) {
     93        if (*((uint32_t *) istate->epc) == 0x7c03e83b) {
    9694                ASSERT(THREAD);
    9795                istate->epc += 4;
    9896                istate->v1 = istate->k1;
    99         } else 
     97        } else
    10098                unhandled_exception(n, istate);
    10199}
  • kernel/arch/mips32/src/mm/tlb.c

    ra634485 ra000878c  
    321321void tlb_refill_fail(istate_t *istate)
    322322{
    323         char *symbol, *sym2;
    324 
    325         symbol = symtab_fmt_name_lookup(istate->epc);
    326         sym2 = symtab_fmt_name_lookup(istate->ra);
     323        const char *symbol = symtab_fmt_name_lookup(istate->epc);
     324        const char *sym2 = symtab_fmt_name_lookup(istate->ra);
    327325       
    328326        fault_if_from_uspace(istate, "TLB Refill Exception on %p.",
     
    335333void tlb_invalid_fail(istate_t *istate)
    336334{
    337         char *symbol;
    338 
    339         symbol = symtab_fmt_name_lookup(istate->epc);
    340 
     335        const char *symbol = symtab_fmt_name_lookup(istate->epc);
     336       
    341337        fault_if_from_uspace(istate, "TLB Invalid Exception on %p.",
    342338            cp0_badvaddr_read());
     
    347343void tlb_modified_fail(istate_t *istate)
    348344{
    349         char *symbol;
    350 
    351         symbol = symtab_fmt_name_lookup(istate->epc);
    352 
     345        const char *symbol = symtab_fmt_name_lookup(istate->epc);
     346       
    353347        fault_if_from_uspace(istate, "TLB Modified Exception on %p.",
    354348            cp0_badvaddr_read());
Note: See TracChangeset for help on using the changeset viewer.