[PATCH 07/12] ARM: add early malloc support needed by the decompressor

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Aug 3 06:25:17 EDT 2012


This is not needed by lzo but by gunzip, xz and others.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 arch/arm/cpu/start-pbl.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 17e0829..dd5c483 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -23,11 +23,15 @@
 
 #include <common.h>
 #include <init.h>
+#include <sizes.h>
 #include <asm/barebox-arm.h>
 #include <asm/barebox-arm-head.h>
 #include <asm-generic/memory_layout.h>
 #include <asm/sections.h>
 
+unsigned long free_mem_ptr;
+unsigned long free_mem_end_ptr;
+
 void __naked __section(.text_head_entry) pbl_start(void)
 {
 	barebox_arm_head();
@@ -46,6 +50,10 @@ static void barebox_uncompress(void *compressed_start, unsigned int len)
 {
 	void (*barebox)(void);
 
+	/* set 128 KiB at the end of the MALLOC_BASE for early malloc */
+	free_mem_ptr = MALLOC_BASE + MALLOC_SIZE - SZ_128K;
+	free_mem_end_ptr = free_mem_ptr + SZ_128K;
+
 	if (IS_ENABLED(CONFIG_THUMB2_BAREBOX))
 		barebox = (void *)(TEXT_BASE + 1);
 	else
-- 
1.7.10.4




More information about the barebox mailing list