Changeset ab3a851 in mainline for kernel/generic/src/debug/panic.c


Ignore:
Timestamp:
2010-11-30T00:50:25Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b2981aa
Parents:
178673c (diff), 41a7f62 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

Local changes: fixed printf related warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/debug/panic.c

    r178673c rab3a851  
    4242#include <interrupt.h>
    4343
     44#define BANNER_LEFT   "######>"
     45#define BANNER_RIGHT  "<######"
     46
    4447void panic_common(panic_category_t cat, istate_t *istate, int access,
    4548    uintptr_t address, const char *fmt, ...)
    4649{
    4750        va_list args;
    48 
     51       
    4952        silent = false;
    50 
    51         printf("\nKERNEL PANIC ");
     53       
     54        printf("\n%s Kernel panic ", BANNER_LEFT);
    5255        if (CPU)
    53                 printf("ON cpu%d ", CPU->id);
    54         printf("DUE TO ");
    55 
     56                printf("on cpu%u ", CPU->id);
     57        printf("due to ");
     58       
    5659        va_start(args, fmt);
    5760        if (cat == PANIC_ASSERT) {
    58                 printf("A FAILED ASSERTION:\n");
     61                printf("a failed assertion: %s\n", BANNER_RIGHT);
    5962                vprintf(fmt, args);
    6063                printf("\n");
    6164        } else if (cat == PANIC_BADTRAP) {
    62                 printf("BAD TRAP %ld.\n", address);
     65                printf("bad trap %" PRIun ". %s\n", address,
     66                    BANNER_RIGHT);
    6367                if (fmt) {
    6468                        vprintf(fmt, args);
     
    6670                }
    6771        } else if (cat == PANIC_MEMTRAP) {
    68                 printf("A BAD MEMORY ACCESS WHILE ");
     72                printf("a bad memory access while ");
    6973                if (access == PF_ACCESS_READ)
    70                         printf("LOADING FROM");
     74                        printf("loading from");
    7175                else if (access == PF_ACCESS_WRITE)
    72                         printf("STORING TO");
     76                        printf("storing to");
    7377                else if (access == PF_ACCESS_EXEC)
    74                         printf("BRANCHING TO");
     78                        printf("branching to");
    7579                else
    76                         printf("REFERENCING");
    77                 printf(" ADDRESS %p.\n", address);
     80                        printf("referencing");
     81                printf(" address %p. %s\n", (void *) address,
     82                    BANNER_RIGHT);
    7883                if (fmt) {
    7984                        vprintf(fmt, args);
     
    8186                }
    8287        } else {
    83                 printf("THE FOLLOWING REASON:\n");
     88                printf("the following reason: %s\n",
     89                    BANNER_RIGHT);
    8490                vprintf(fmt, args);
    8591                printf("\n");
    8692        }
    8793        va_end(args);
    88 
     94       
    8995        printf("\n");
    90 
     96       
    9197        if (istate) {
    9298                istate_decode(istate);
    9399                printf("\n");
    94100        }
    95 
     101       
    96102        stack_trace();
    97103        halt();
Note: See TracChangeset for help on using the changeset viewer.