Skip to contentSkip to conversation

MPC512x: Change traps.c to not reference non-addressable memory

PATCH New becky.bruce at freescale.com 2 participants 2 messages May 14, 2008 – Jun 4, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MPC512x: Change traps.c to not reference non-addressable memory

From: Becky Bruce <[email protected]>

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.

---
 cpu/mpc512x/traps.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
cpu/mpc512x/traps.c +7 -1
index 8455c92..8000fab 100644
@@ -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
Signature · 1 line
1.5.4.1
#1 lore raw

PATCH 1/1 MPC512x: Change traps.c to not reference non-addressable memory

Quoted 9 lines · In message <[email protected]> you…

From: Becky Bruce <[email protected]>

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.

Quoted 4 lines
---
 cpu/mpc512x/traps.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

Applied, thanks!

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The sight of death frightens them [Earthers].
	-- Kras the Klingon, "Friday's Child", stardate 3497.2