aboutsummaryrefslogtreecommitdiff
path: root/core/exceptions.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2015-03-27 16:11:40 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-03-31 15:42:37 +1100
commit989d8b68b63ba21a58fb96cd0b0a82505e669046 (patch)
tree74388ed44bae1f00319108dba9aeed1927208242 /core/exceptions.c
parente162dbe49d12603ed9663a16f3040fbe6fddb9e9 (diff)
downloadskiboot-989d8b68b63ba21a58fb96cd0b0a82505e669046.zip
skiboot-989d8b68b63ba21a58fb96cd0b0a82505e669046.tar.gz
skiboot-989d8b68b63ba21a58fb96cd0b0a82505e669046.tar.bz2
exceptions: Catch exceptions at boot time
And print some informations about GPR state, backtrace, etc... Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/exceptions.c')
-rw-r--r--core/exceptions.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/core/exceptions.c b/core/exceptions.c
index 83efa36..8416190 100644
--- a/core/exceptions.c
+++ b/core/exceptions.c
@@ -28,18 +28,14 @@ static void dump_regs(struct stack_frame *stack)
{
unsigned int i;
- printf("SRR0 : "REG" SRR1 : "REG"\n", stack->srr0, stack->srr1);
- printf("HSRR0: "REG" HSRR1: "REG"\n", stack->srr0, stack->srr1);
- printf("CFAR : "REG" LR : "REG" CTR: "REG"\n",
- stack->cfar, stack->lr, stack->ctr);
- printf(" CR: %08x XER: %08x\n", stack->cr, stack->xer);
-
- for (i = 0; i < 32; i++) {
- if ((i % REGS_PER_LINE) == 0)
- printf("\nGPR%02d: ", i);
- printf(REG " ", stack->gpr[i]);
- }
- printf("\n");
+ prerror("SRR0 : "REG" SRR1 : "REG"\n", stack->srr0, stack->srr1);
+ prerror("HSRR0: "REG" HSRR1: "REG"\n", stack->srr0, stack->srr1);
+ prerror("LR : "REG" CTR : "REG"\n", stack->lr, stack->ctr);
+ prerror("CFAR : "REG"\n", stack->cfar);
+ prerror("CR : %08x XER: %08x\n", stack->cr, stack->xer);
+ for (i = 0; i < 16; i++)
+ prerror("GPR%02d: "REG" GPR%02d: "REG"\n",
+ i, stack->gpr[i], i + 16, stack->gpr[i + 16]);
}
/* Called from head.S, thus no prototype */
@@ -47,9 +43,9 @@ void exception_entry(struct stack_frame *stack) __noreturn;
void exception_entry(struct stack_frame *stack)
{
+ prerror("***********************************************\n");
prerror("Unexpected exception %llx !\n", stack->type);
dump_regs(stack);
- backtrace();
_abort();
}