diff mbox

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

Message ID 1412948960-11941-5-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Oct. 10, 2014, 1:49 p.m. UTC
Add support for this by reserving a block of memory below global_data.

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

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

Comments

Simon Glass Oct. 24, 2014, 3:54 a.m. UTC | #1
On 10 October 2014 07:49, Simon Glass <sjg@chromium.org> wrote:
> Add support for this by reserving a block of memory below global_data.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  arch/x86/cpu/start.S | 7 +++++++
>  1 file changed, 7 insertions(+)

Applied to u-boot-dm/master
diff mbox

Patch

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