summaryrefslogtreecommitdiff
path: root/cpu/at32ap/exception.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2007-04-18 16:53:52 +0200
committerWolfgang Denk <wd@denx.de>2007-04-18 16:53:52 +0200
commitb99c1e6d8eec327c4b4dd99bf4c0d1a1eba2ce0a (patch)
tree2ba585aa362b4fc2859ead56014b39f74586662d /cpu/at32ap/exception.c
parent5f6c732affea9647762d27a4617a2ae64c52dceb (diff)
parent8e6875183cdca91c134408d119d4abcd48ef6856 (diff)
downloadu-boot-imx-b99c1e6d8eec327c4b4dd99bf4c0d1a1eba2ce0a.zip
u-boot-imx-b99c1e6d8eec327c4b4dd99bf4c0d1a1eba2ce0a.tar.gz
u-boot-imx-b99c1e6d8eec327c4b4dd99bf4c0d1a1eba2ce0a.tar.bz2
Merge with /home/wd/git/u-boot/custodian/u-boot-avr32; code cleanup.
Diffstat (limited to 'cpu/at32ap/exception.c')
-rw-r--r--cpu/at32ap/exception.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpu/at32ap/exception.c b/cpu/at32ap/exception.c
index 4123c44..0672685 100644
--- a/cpu/at32ap/exception.c
+++ b/cpu/at32ap/exception.c
@@ -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,10 @@ 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 < CFG_SDRAM_BASE || 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");
}