Przeglądaj źródła

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>
Becky Bruce 17 lat temu
rodzic
commit
9b124a6834
1 zmienionych plików z 7 dodań i 1 usunięć
  1. 7 1
      cpu/mpc512x/traps.c

+ 7 - 1
cpu/mpc512x/traps.c

@@ -34,7 +34,13 @@ DECLARE_GLOBAL_DATA_PTR;
 
 
 extern unsigned long search_exception_table(unsigned long);
 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
  * Trap & Exception support