]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
MPC86xx: Change traps.c to not reference non-addressable memory
authorBecky Bruce <becky.bruce@freescale.com>
Wed, 14 May 2008 18:09:58 +0000 (13:09 -0500)
committerJon Loeliger <jdl@freescale.com>
Fri, 6 Jun 2008 15:55:35 +0000 (10:55 -0500)
Currently, END_OF_RAM is used by the trap code to determine if
we should attempt to access the stack pointer or not. However,
on systems with a lot of RAM, only a subset of the RAM is
guaranteed to be mapped in and accessible.  Change END_OF_RAM
to use get_effective_memsize() instead of using the raw ram
size out of the bd to prevent us from trying to access
non-mapped memory.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
cpu/mpc86xx/traps.c

index 04c2e1331b645c531c1b3a74209f996031e5b1b9..5695c3e453ae9bc6f852cea5b0b5737dbb690d20 100644 (file)
@@ -43,7 +43,13 @@ int (*debugger_exception_handler)(struct pt_regs *) = 0;
 /* Returns 0 if exception not found and fixup otherwise.  */
 extern unsigned long search_exception_table(unsigned long);
 
-#define END_OF_MEM (gd->bd->bi_memstart + gd->bd->bi_memsize)
+/*
+ * End of addressable memory.  This may be less than the actual
+ * amount of memory on the system if we're unable to keep all
+ * the memory mapped in.
+ */
+extern ulong get_effective_memsize(void);
+#define END_OF_MEM (gd->bd->bi_memstart + get_effective_memsize())
 
 /*
  * Trap & Exception support