Skip to contentSkip to conversation

spl: Allow settings malloc_f base address

PATCH In review Marek Vasut 3 participants 4 messages May 25, 2016 – Jun 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spl: Allow settings malloc_f base address

Allow configuring the begining of the malloc_f area in SPL. This patch uses the same CONFIG_MALLOC_F_ADDR established by the sandbox.

---
 common/spl/spl.c | 3 +++
 1 file changed, 3 insertions(+)
common/spl/spl.c +3 -0
index 93f9bd1..56c64d1 100644
@@ -160,6 +160,9 @@ int spl_init(void)
 
 	debug("spl_init()\n");
 #if defined(CONFIG_SYS_MALLOC_F_LEN)
+#ifdef CONFIG_MALLOC_F_ADDR
+	gd->malloc_base = CONFIG_MALLOC_F_ADDR;
+#endif
 	gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN;
 	gd->malloc_ptr = 0;
 #endif
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/1 spl: Allow settings malloc_f base address

Hi Marek,

Quoted 3 lines · Marek Vasut

Allow configuring the begining of the malloc_f area in SPL. This patch uses the same CONFIG_MALLOC_F_ADDR established by the sandbox.

What is this used for? Is the existing scheme (using the stack space) not suitable? I think it should move to Kconfig before being used more widely.

Quoted 23 lines
---
 common/spl/spl.c | 3 +++
 1 file changed, 3 insertions(+)
common/spl/spl.c +3 -1
index 93f9bd1..56c64d1 100644
@@ -160,6 +160,9 @@ int spl_init(void)
 
        debug("spl_init()\n");
 #if defined(CONFIG_SYS_MALLOC_F_LEN)
+#ifdef CONFIG_MALLOC_F_ADDR
+       gd->malloc_base = CONFIG_MALLOC_F_ADDR;
+#endif
        gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN;
        gd->malloc_ptr = 0;
 #endif
--
Quoted 2 lines

2.7.0

Regards,
Simon

#2 lore raw

PATCH 1/1 spl: Allow settings malloc_f base address

Quoted 1 line · Simon Glass

Hi Marek,

Hi!

Quoted 8 lines · Marek Vasut
Quoted 3 lines

Allow configuring the begining of the malloc_f area in SPL. This patch uses the same CONFIG_MALLOC_F_ADDR established by the sandbox.

What is this used for? Is the existing scheme (using the stack space) not suitable? I think it should move to Kconfig before being used more widely.

In case your stack is waaay too constrained, then this is not suitable, yep :(

Quoted 29 lines
Quoted 23 lines
---
 common/spl/spl.c | 3 +++
 1 file changed, 3 insertions(+)
common/spl/spl.c +3 -1
index 93f9bd1..56c64d1 100644
@@ -160,6 +160,9 @@ int spl_init(void)
 
        debug("spl_init()\n");
 #if defined(CONFIG_SYS_MALLOC_F_LEN)
+#ifdef CONFIG_MALLOC_F_ADDR
+       gd->malloc_base = CONFIG_MALLOC_F_ADDR;
+#endif
        gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN;
        gd->malloc_ptr = 0;
 #endif
--
Quoted 2 lines

2.7.0

Regards,
Simon

Signature · 2 lines
Best regards,
Marek Vasut
#3 lore raw
In reply to Marek Vasut
Quoted 7 lines · Marek Vasut

Allow configuring the begining of the malloc_f area in SPL. This patch uses the same CONFIG_MALLOC_F_ADDR established by the sandbox.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160603/dd22e5c9/attachment.sig>