]> git.sur5r.net Git - u-boot/blobdiff - arch/avr32/cpu/exception.c
stm32: Correct positioning of declaration
[u-boot] / arch / avr32 / cpu / exception.c
index 828fc00a49d3b5af488e9cd20ce709c39f4bef03..22eab03b12ca1b3f3e62d8d1c34ffaff6e4d5ddc 100644 (file)
@@ -1,23 +1,7 @@
 /*
  * Copyright (C) 2005-2006 Atmel Corporation
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
 
@@ -26,6 +10,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define STACKSIZE      2048
+
 static const char * const cpu_modes[8] = {
        "Application", "Supervisor", "Interrupt level 0", "Interrupt level 1",
        "Interrupt level 2", "Interrupt level 3", "Exception", "NMI"
@@ -112,11 +98,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 - 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");
 }