]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
microblaze: Show return address from exception
authorMichal Simek <michal.simek@xilinx.com>
Mon, 26 Jan 2015 13:32:23 +0000 (14:32 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 10:59:16 +0000 (12:59 +0200)
Show also return address from exception which should
suggest where the problem is.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/microblaze/cpu/exception.c
arch/microblaze/include/asm/asm.h

index 227842f6a483a585a36574fa5857557c00affc61..45729331f3d326baeca82e3511c090bee519b871 100644 (file)
@@ -18,6 +18,8 @@ void _hw_exception_handler (void)
        /* loading excetpion state register ESR */
        MFS (state, resr);
        printf ("Hardware exception at 0x%x address\n", address);
+       R17(address);
+       printf("Return address from exception 0x%x\n", address);
        switch (state & 0x1f) { /* mask on exception cause */
        case 0x1:
                puts ("Unaligned data access exception\n");
index c1c3b03985795a966dff2d821b79bb19ead98d39..11f3dd0f0ec026acba812efffc8351114bf2a334 100644 (file)
 #define R14(val) \
        __asm__ __volatile__ ("addi %0, r14, 0":"=r" (val));
 
+/* get return address from interrupt */
+#define R17(val) \
+       __asm__ __volatile__ ("addi %0, r17, 0" : "=r" (val));
+
 #define NOP    __asm__ __volatile__ ("nop");
 
 /* use machine status registe USE_MSR_REG */