summaryrefslogtreecommitdiffstats
path: root/cpu/mpc86xx
diff options
context:
space:
mode:
authorBecky Bruce <becky.bruce@freescale.com>2008-05-14 13:09:58 -0500
committerJon Loeliger <jdl@freescale.com>2008-06-06 10:55:35 -0500
commit279726bd00558e80263d44581c44167625b7fb9a (patch)
treece58980690892c79147b8d38aef7edfb636bdbb4 /cpu/mpc86xx
parent1a247ba7fa5fb09f56892a09a990f03ce564b3e2 (diff)
downloadtalos-obmc-uboot-279726bd00558e80263d44581c44167625b7fb9a.tar.gz
talos-obmc-uboot-279726bd00558e80263d44581c44167625b7fb9a.zip
MPC86xx: Change traps.c to not reference non-addressable memory
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>
Diffstat (limited to 'cpu/mpc86xx')
-rw-r--r--cpu/mpc86xx/traps.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cpu/mpc86xx/traps.c b/cpu/mpc86xx/traps.c
index 04c2e1331b..5695c3e453 100644
--- a/cpu/mpc86xx/traps.c
+++ b/cpu/mpc86xx/traps.c
@@ -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
OpenPOWER on IntegriCloud