diff options
author | Becky Bruce <becky.bruce@freescale.com> | 2008-05-14 13:09:51 -0500 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-06-03 19:47:14 +0200 |
commit | 9b124a68346ce9605b6e1fcf79e1021541cdba9e (patch) | |
tree | 4b5a015b0dcf5b2ab17765498519bf8ea12355ab /cpu | |
parent | 81673e9ae14b771cd13faf19947192599cae3959 (diff) | |
download | u-boot-9b124a68346ce9605b6e1fcf79e1021541cdba9e.zip u-boot-9b124a68346ce9605b6e1fcf79e1021541cdba9e.tar.gz u-boot-9b124a68346ce9605b6e1fcf79e1021541cdba9e.tar.bz2 |
MPC512x: 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.
Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Diffstat (limited to 'cpu')
-rw-r--r-- | cpu/mpc512x/traps.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cpu/mpc512x/traps.c b/cpu/mpc512x/traps.c index 8455c92..8000fab 100644 --- a/cpu/mpc512x/traps.c +++ b/cpu/mpc512x/traps.c @@ -34,7 +34,13 @@ DECLARE_GLOBAL_DATA_PTR; 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 |