Ignore:
File:
1 edited

Legend:

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

    r7e752b2 rd5a1c73  
    4242#include <interrupt.h>
    4343
    44 #define BANNER_LEFT   "######>"
    45 #define BANNER_RIGHT  "<######"
    46 
    4744void panic_common(panic_category_t cat, istate_t *istate, int access,
    4845    uintptr_t address, const char *fmt, ...)
    4946{
    5047        va_list args;
    51        
     48
    5249        silent = false;
    53        
    54         printf("\n%s Kernel panic ", BANNER_LEFT);
     50
     51        printf("\nKERNEL PANIC ");
    5552        if (CPU)
    56                 printf("on cpu%u ", CPU->id);
    57         printf("due to ");
    58        
     53                printf("ON cpu%d ", CPU->id);
     54        printf("DUE TO ");
     55
    5956        va_start(args, fmt);
    6057        if (cat == PANIC_ASSERT) {
    61                 printf("a failed assertion: %s\n", BANNER_RIGHT);
     58                printf("A FAILED ASSERTION:\n");
    6259                vprintf(fmt, args);
    6360                printf("\n");
    6461        } else if (cat == PANIC_BADTRAP) {
    65                 printf("bad trap %" PRIun ". %s\n", address,
    66                     BANNER_RIGHT);
     62                printf("BAD TRAP %ld.\n", address);
    6763                if (fmt) {
    6864                        vprintf(fmt, args);
     
    7066                }
    7167        } else if (cat == PANIC_MEMTRAP) {
    72                 printf("a bad memory access while ");
     68                printf("A BAD MEMORY ACCESS WHILE ");
    7369                if (access == PF_ACCESS_READ)
    74                         printf("loading from");
     70                        printf("LOADING FROM");
    7571                else if (access == PF_ACCESS_WRITE)
    76                         printf("storing to");
     72                        printf("STORING TO");
    7773                else if (access == PF_ACCESS_EXEC)
    78                         printf("branching to");
     74                        printf("BRANCHING TO");
    7975                else
    80                         printf("referencing");
    81                 printf(" address %p. %s\n", (void *) address,
    82                     BANNER_RIGHT);
     76                        printf("REFERENCING");
     77                printf(" ADDRESS %p.\n", address);
    8378                if (fmt) {
    8479                        vprintf(fmt, args);
     
    8681                }
    8782        } else {
    88                 printf("the following reason: %s\n",
    89                     BANNER_RIGHT);
     83                printf("THE FOLLOWING REASON:\n");
    9084                vprintf(fmt, args);
    9185                printf("\n");
    9286        }
    9387        va_end(args);
    94        
     88
    9589        printf("\n");
    96        
     90
    9791        if (istate) {
    9892                istate_decode(istate);
    9993                printf("\n");
    10094        }
    101        
     95
    10296        stack_trace();
    10397        halt();
Note: See TracChangeset for help on using the changeset viewer.