Changes in kernel/generic/src/debug/panic.c [7e752b2:d5a1c73] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/debug/panic.c
r7e752b2 rd5a1c73 42 42 #include <interrupt.h> 43 43 44 #define BANNER_LEFT "######>"45 #define BANNER_RIGHT "<######"46 47 44 void panic_common(panic_category_t cat, istate_t *istate, int access, 48 45 uintptr_t address, const char *fmt, ...) 49 46 { 50 47 va_list args; 51 48 52 49 silent = false; 53 54 printf("\n %s Kernel panic ", BANNER_LEFT);50 51 printf("\nKERNEL PANIC "); 55 52 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 59 56 va_start(args, fmt); 60 57 if (cat == PANIC_ASSERT) { 61 printf(" a failed assertion: %s\n", BANNER_RIGHT);58 printf("A FAILED ASSERTION:\n"); 62 59 vprintf(fmt, args); 63 60 printf("\n"); 64 61 } else if (cat == PANIC_BADTRAP) { 65 printf("bad trap %" PRIun ". %s\n", address, 66 BANNER_RIGHT); 62 printf("BAD TRAP %ld.\n", address); 67 63 if (fmt) { 68 64 vprintf(fmt, args); … … 70 66 } 71 67 } else if (cat == PANIC_MEMTRAP) { 72 printf(" a bad memory access while");68 printf("A BAD MEMORY ACCESS WHILE "); 73 69 if (access == PF_ACCESS_READ) 74 printf(" loading from");70 printf("LOADING FROM"); 75 71 else if (access == PF_ACCESS_WRITE) 76 printf(" storing to");72 printf("STORING TO"); 77 73 else if (access == PF_ACCESS_EXEC) 78 printf(" branching to");74 printf("BRANCHING TO"); 79 75 else 80 printf("referencing"); 81 printf(" address %p. %s\n", (void *) address, 82 BANNER_RIGHT); 76 printf("REFERENCING"); 77 printf(" ADDRESS %p.\n", address); 83 78 if (fmt) { 84 79 vprintf(fmt, args); … … 86 81 } 87 82 } else { 88 printf("the following reason: %s\n", 89 BANNER_RIGHT); 83 printf("THE FOLLOWING REASON:\n"); 90 84 vprintf(fmt, args); 91 85 printf("\n"); 92 86 } 93 87 va_end(args); 94 88 95 89 printf("\n"); 96 90 97 91 if (istate) { 98 92 istate_decode(istate); 99 93 printf("\n"); 100 94 } 101 95 102 96 stack_trace(); 103 97 halt();
Note:
See TracChangeset
for help on using the changeset viewer.