浏览代码

[POWERPC] bootwrapper: cuboot-83xx: Exclude upper 1MB from heap.

The uppermost part of memory is where u-boot puts the stack, so don't
include that in the heap.  It's not currently causing problems, as the
current code allocates from the bottom of the heap, but this will keep
things from potentially breaking if a future implementation were to
allocate from the top.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Scott Wood 18 年之前
父节点
当前提交
173ba87b95
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      arch/powerpc/boot/cuboot-83xx.c

+ 1 - 1
arch/powerpc/boot/cuboot-83xx.c

@@ -61,7 +61,7 @@ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
 	loader_info.cmdline = (char *)r6;
 	loader_info.cmdline = (char *)r6;
 	loader_info.cmdline_len = r7 - r6;
 	loader_info.cmdline_len = r7 - r6;
 
 
-	simple_alloc_init(_end, avail_ram, 32, 64);
+	simple_alloc_init(_end, avail_ram - 1024*1024, 32, 64);
 	ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
 	ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
 	serial_console_init();
 	serial_console_init();
 	platform_ops.fixups = platform_fixups;
 	platform_ops.fixups = platform_fixups;