avr32: use generic gd->start_addr_sp
authorAndreas Bießmann <andreas.devel@googlemail.com>
Fri, 6 Feb 2015 22:06:44 +0000 (23:06 +0100)
committerAndreas Bießmann <andreas.devel@googlemail.com>
Tue, 17 Feb 2015 21:52:41 +0000 (22:52 +0100)
Before avr32 had an extra storage for stack end to have a nice stack printout
on exception. Remove this extra storage and use generic gd->start_addr_sp
instead.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
arch/avr32/cpu/exception.c
arch/avr32/include/asm/global_data.h
arch/avr32/lib/board.c

index 5d1bc689f85d4f9977d490a23d30dfd7168966f8..d6991f6668d3326bfaf205719f9f421bbfff7f25 100644 (file)
@@ -96,11 +96,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 < (gd->arch.stack_end - CONFIG_STACKSIZE)
-                       || regs->sp >= gd->arch.stack_end)
+       if (regs->sp < (gd->start_addr_sp - CONFIG_STACKSIZE) ||
+           regs->sp >= gd->start_addr_sp)
                printf("\nStack pointer seems bogus, won't do stack dump\n");
        else
-               dump_mem("\nStack: ", regs->sp, gd->arch.stack_end);
+               dump_mem("\nStack: ", regs->sp, gd->start_addr_sp);
 
        panic("Unhandled exception\n");
 }
index d82fb7cc6d807c63637b452e83f15352713423e1..60abd007821cf76e0a96f45b08acde1762d68816 100644 (file)
@@ -8,7 +8,6 @@
 
 /* Architecture-specific global data */
 struct arch_global_data {
-       unsigned long stack_end;        /* highest stack address */
        unsigned long cpu_hz;           /* cpu core clock frequency */
 };
 
index 13b7fede74bf499b7c024baf523099e45381d3f1..99aa96e23fab0498e7e4bc636ac0ea464e4b9d18 100644 (file)
@@ -157,7 +157,7 @@ void board_init_f(ulong board_type)
 
        /* And finally, a new, bigger stack. */
        new_sp = (unsigned long *)addr;
-       gd->arch.stack_end = addr;
+       gd->start_addr_sp = addr;
        *(--new_sp) = 0;
        *(--new_sp) = 0;