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