Skip to content

Commit

Permalink
core/exceptions.c: rearrange code to allow more interrupt types
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
npiggin authored and oohal committed Oct 2, 2019
1 parent 6266148 commit b70e8af
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions core/exceptions.c
Expand Up @@ -69,24 +69,32 @@ void exception_entry(struct stack_frame *stack)
if (!(msr & MSR_RI))
fatal = true;

prerror("***********************************************\n");
l = 0;
if (stack->type == 0x100) {
switch (stack->type) {
case 0x100:
prerror("***********************************************\n");
if (fatal) {
l += snprintf(buf + l, EXCEPTION_MAX_STR - l,
"Fatal System Reset at "REG" ", nip);
} else {
l += snprintf(buf + l, EXCEPTION_MAX_STR - l,
"System Reset at "REG" ", nip);
}
} else if (stack->type == 0x200) {
break;

case 0x200:
fatal = true;
prerror("***********************************************\n");
l += snprintf(buf + l, EXCEPTION_MAX_STR - l,
"Fatal MCE at "REG" ", nip);
} else {
break;

default:
fatal = true;
prerror("***********************************************\n");
l += snprintf(buf + l, EXCEPTION_MAX_STR - l,
"Fatal Exception 0x%llx at "REG" ", stack->type, nip);
break;
}
l += snprintf_symbol(buf + l, EXCEPTION_MAX_STR - l, nip);
l += snprintf(buf + l, EXCEPTION_MAX_STR - l, " MSR "REG, msr);
Expand Down

0 comments on commit b70e8af

Please sign in to comment.