]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - cpu/at32ap/exception.c
imported Freescale specific U-Boot additions for i.MX28,... release L2.6.31_10.08.01
[karo-tx-uboot.git] / cpu / at32ap / exception.c
index 4123c446167ad4bc93523445fb570ac3cea306ac..dc9c3002a49631522d01ec8a7a66b3ab13c1cf12 100755 (executable)
@@ -24,6 +24,8 @@
 #include <asm/sysreg.h>
 #include <asm/ptrace.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static const char * const cpu_modes[8] = {
        "Application", "Supervisor", "Interrupt level 0", "Interrupt level 1",
        "Interrupt level 2", "Interrupt level 3", "Exception", "NMI"
@@ -109,11 +111,11 @@ void do_unknown_exception(unsigned int ecr, struct pt_regs *regs)
        printf("CPU Mode: %s\n", cpu_modes[mode]);
 
        /* Avoid exception loops */
-       if (regs->sp >= CFG_INIT_SP_ADDR
-           || regs->sp < (CFG_INIT_SP_ADDR - CONFIG_STACKSIZE))
+       if (regs->sp < (gd->stack_end - CONFIG_STACKSIZE)
+                       || regs->sp >= gd->stack_end)
                printf("\nStack pointer seems bogus, won't do stack dump\n");
        else
-               dump_mem("\nStack: ", regs->sp, CFG_INIT_SP_ADDR);
+               dump_mem("\nStack: ", regs->sp, gd->stack_end);
 
        panic("Unhandled exception\n");
 }