From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] env_mmc: fix buffer allocation for armv7
Date: Mon, 7 Oct 2013 08:20:20 -0400 [thread overview]
Message-ID: <20131007122020.GT15917@bill-the-cat> (raw)
In-Reply-To: <20131007053424.B4FAD380435@gemini.denx.de>
On Mon, Oct 07, 2013 at 07:34:24AM +0200, Wolfgang Denk wrote:
> Dear Tom,
>
> In message <20131006204214.GO15917@bill-the-cat> you wrote:
> >
> > > Why do you hesitate to use the stack?
> >
> > Mainly to allow us to work in restricted stack areas like SPL where we
> > simply may not have that much space available.
>
> But malloc() is drawing from the very same resource as the stack, even
> more so: with a buffer on the stack, the memory isfreed completeky
> upon return from the fucntion, with no reminders left. With malloc()
> you need to statically allocate the malloc pool size for the whole
> runtime, and allocating the buffers may fragment tha area, so even
> after freeing the buffers there is less space left for other purposes.
>
> Especially in memory-tight situations you want to avoid malloc().
Ah, but in these cases we don't have stack room, period. We have a
malloc pool. So unless we make SPL move its stack pointer into DDR from
wherever we set the initial one to, the other option here is to just
restrict real env support to NOR (and we already don't allow embedded
env, since that's embedded within U-Boot, not SPL).
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> It's all Klatchian to me.
> - Terry Pratchett & Stephen Briggs, _The Discworld Companion_
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131007/f878ad42/attachment.pgp>
next prev parent reply other threads:[~2013-10-07 12:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-04 13:48 [U-Boot] [PATCH] env_mmc: fix buffer allocation for armv7 Markus Niebel
2013-10-04 17:02 ` Tom Rini
2013-10-05 19:57 ` Wolfgang Denk
2013-10-06 20:42 ` Tom Rini
2013-10-07 5:34 ` Wolfgang Denk
2013-10-07 12:20 ` Tom Rini [this message]
2013-10-07 13:58 ` Wolfgang Denk
2013-10-08 13:44 ` Tom Rini
2013-10-08 18:17 ` Wolfgang Denk
2013-10-11 18:27 ` Tom Rini
2013-10-07 7:58 ` Markus Niebel
2013-10-14 20:26 ` [U-Boot] " Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131007122020.GT15917@bill-the-cat \
--to=trini@ti.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox