[U-Boot] [PATCH 4/8] dm: x86: Support pre-reloc malloc()

Simon Glass sjg at chromium.org
Fri Oct 10 15:49:16 CEST 2014


Add support for this by reserving a block of memory below global_data.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/x86/cpu/start.S | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
index 71cab22..338bab1 100644
--- a/arch/x86/cpu/start.S
+++ b/arch/x86/cpu/start.S
@@ -97,6 +97,13 @@ car_init_ret:
 	/* Reserve space for global descriptor table */
 	subl	$X86_GDT_SIZE, %esp
 
+#if defined(CONFIG_SYS_MALLOC_F_LEN)
+	subl	$CONFIG_SYS_MALLOC_F_LEN, %esp
+	movl	%eax, %edx
+	addl	$GD_MALLOC_BASE, %edx
+	movl	%esp, (%edx)
+#endif
+
 	/* Align temporary global descriptor table to 16-byte boundary */
 	andl	$0xfffffff0, %esp
 
-- 
2.1.0.rc2.206.gedb03e5



More information about the U-Boot mailing list