avr32: Move stack_end to arch_global_data
authorSimon Glass <sjg@chromium.org>
Thu, 13 Dec 2012 20:49:09 +0000 (20:49 +0000)
committerTom Rini <trini@ti.com>
Mon, 4 Feb 2013 14:05:44 +0000 (09:05 -0500)
Move this field into arch_global_data and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/avr32/cpu/exception.c
arch/avr32/include/asm/global_data.h
arch/avr32/lib/board.c

index b21ef1f928daaf891d8d749ee158b44fd33bb359..828fc00a49d3b5af488e9cd20ce709c39f4bef03 100644 (file)
@@ -112,11 +112,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->stack_end - CONFIG_STACKSIZE)
-                       || regs->sp >= gd->stack_end)
+       if (regs->sp < (gd->arch.stack_end - CONFIG_STACKSIZE)
+                       || regs->sp >= gd->arch.stack_end)
                printf("\nStack pointer seems bogus, won't do stack dump\n");
        else
-               dump_mem("\nStack: ", regs->sp, gd->stack_end);
+               dump_mem("\nStack: ", regs->sp, gd->arch.stack_end);
 
        panic("Unhandled exception\n");
 }
index 236a9da5437438de0fb574b9796b3ea761efeeb9..3be8628784c7f94af3cdaf1de670fa468043c4de 100644 (file)
@@ -24,6 +24,7 @@
 
 /* Architecture-specific global data */
 struct arch_global_data {
+       unsigned long stack_end;        /* highest stack address */
 };
 
 /*
@@ -38,7 +39,6 @@ typedef       struct  global_data {
        bd_t            *bd;
        unsigned long   flags;
        unsigned int    baudrate;
-       unsigned long   stack_end;      /* highest stack address */
        unsigned long   have_console;   /* serial_init() was called */
 #ifdef CONFIG_PRE_CONSOLE_BUFFER
        unsigned long   precon_buf_idx; /* Pre-Console buffer index */
index e3287c486b1b985d462e1085b20cb09b8db781b7..d3c8cb76dde081661ad0916641da1cd5fc6d363a 100644 (file)
@@ -231,7 +231,7 @@ void board_init_f(ulong board_type)
 
        /* And finally, a new, bigger stack. */
        new_sp = (unsigned long *)addr;
-       gd->stack_end = addr;
+       gd->arch.stack_end = addr;
        *(--new_sp) = 0;
        *(--new_sp) = 0;