]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
arc: add ECR (exception cause register) output
authorIgor Guryanov <guryanov@synopsys.com>
Wed, 24 Dec 2014 13:26:14 +0000 (16:26 +0300)
committerAlexey Brodkin <abrodkin@synopsys.com>
Thu, 15 Jan 2015 19:38:42 +0000 (22:38 +0300)
Exception cause register (ECR) contains value that describes a reason
for exception that has happened. This helps a lot to figure-out what
went wrong.

Now we print this register contents when dumping registers.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
arch/arc/cpu/arc700/interrupts.c
arch/arc/cpu/arc700/start.S

index d93a6eb547bff99c02548a144d48b2d86d42ff68..7dde74b4385653c75c82a88a34288ef92ee17f14 100644 (file)
@@ -61,6 +61,7 @@ static void print_reg_file(long *reg_rev, int start_num)
 
 void show_regs(struct pt_regs *regs)
 {
+       printf("ECR:\t0x%08lx\n", regs->ecr);
        printf("RET:\t0x%08lx\nBLINK:\t0x%08lx\nSTAT32:\t0x%08lx\n",
               regs->ret, regs->blink, regs->status32);
        printf("GP: 0x%08lx\t r25: 0x%08lx\t\n", regs->r26, regs->r25);
index 563513b6904ad01ce9fff550f46c5b3b635b0a92..4d505bfb7ca442a937d7caf196afdc4e3b961f8d 100644 (file)
 .endm
 
 .macro SAVE_ALL_SYS
-
+       /* saving %r0 to reg->r0 in advance since we read %ecr into it */
+       st      %r0, [%sp, -8]
+       lr      %r0, [%ecr]     /* all stack addressing is manual so far */
        st      %r0, [%sp]
-       lr      %r0, [%ecr]
-       st      %r0, [%sp, 8]   /* ECR */
-       st      %sp, [%sp, 4]
+       st      %sp, [%sp, -4]
+       /* now move %sp to reg->r0 position so we can do "push" automatically */
+       sub     %sp, %sp, 8
 
        SAVE_R1_TO_R24
        PUSH    %r25