aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2019-09-25 11:01:33 +1000
committerOliver O'Halloran <oohall@gmail.com>2019-10-03 09:55:58 +1000
commitb70e8afdb09f56e3c7db643862cd3d2fd15a4544 (patch)
tree8b13b081943346aa919f75295d0300ab0e1dbfee
parent6266148e32090267cd534391e35eae3ed4e7800b (diff)
downloadskiboot-b70e8afdb09f56e3c7db643862cd3d2fd15a4544.zip
skiboot-b70e8afdb09f56e3c7db643862cd3d2fd15a4544.tar.gz
skiboot-b70e8afdb09f56e3c7db643862cd3d2fd15a4544.tar.bz2
core/exceptions.c: rearrange code to allow more interrupt types
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
-rw-r--r--core/exceptions.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/core/exceptions.c b/core/exceptions.c
index 90e412b..f853278 100644
--- a/core/exceptions.c
+++ b/core/exceptions.c
@@ -69,9 +69,10 @@ 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);
@@ -79,14 +80,21 @@ void exception_entry(struct stack_frame *stack)
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);