Changeset 89c57b6 in mainline for kernel/generic/src/debug/panic.c
- Timestamp:
- 2011-04-13T14:45:41Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 88634420
- Parents:
- cefb126 (diff), 17279ead (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
rcefb126 r89c57b6 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); 67 if (fmt) { 68 vprintf(fmt, args); 69 printf("\n"); 70 } 63 71 } else if (cat == PANIC_MEMTRAP) { 64 printf(" A BAD MEMORY ACCESS WHILE");72 printf("a bad memory access while "); 65 73 if (access == PF_ACCESS_READ) 66 printf(" LOADING FROM");74 printf("loading from"); 67 75 else if (access == PF_ACCESS_WRITE) 68 printf(" STORING TO");76 printf("storing to"); 69 77 else if (access == PF_ACCESS_EXEC) 70 printf(" BRANCHING TO");78 printf("branching to"); 71 79 else 72 printf("REFERENCING"); 73 printf(" ADDRESS %p.\n", address); 80 printf("referencing"); 81 printf(" address %p. %s\n", (void *) address, 82 BANNER_RIGHT); 83 if (fmt) { 84 vprintf(fmt, args); 85 printf("\n"); 86 } 74 87 } else { 75 printf("THE FOLLOWING REASON:\n"); 88 printf("the following reason: %s\n", 89 BANNER_RIGHT); 76 90 vprintf(fmt, args); 91 printf("\n"); 77 92 } 78 93 va_end(args); 79 94 80 95 printf("\n"); 81 96 82 97 if (istate) { 83 98 istate_decode(istate); 84 99 printf("\n"); 85 100 } 86 101 87 102 stack_trace(); 88 103 halt();
Note:
See TracChangeset
for help on using the changeset viewer.