public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5] Fix board init code to respect the C runtime environment
Date: Fri, 20 Nov 2015 17:26:12 +0100	[thread overview]
Message-ID: <20151120172612.49326273@lilith> (raw)
In-Reply-To: <CAPnjgZ36zEcUtcqb8=i5CohYVogi99MtEUCPVrPBZksxjvgd3g@mail.gmail.com>

Hello Simon,

On Wed, 18 Nov 2015 18:05:07 -0700, Simon Glass <sjg@chromium.org>
wrote:
> Hi Albert,
> 
> >> early malloc() area
> >
> > "Arena", and "malloc arena", are established designations for the
> > memory space used by malloc implementations; and I prefer to use this
> > more specific term, as people may use it as a search keyword when
> > looking for malloc related stuff.
> 
> Arena is OK, but can you please mention 'early' each time? It's
> confusing otherwise. I think we should have a clear distinction
> between the early malloc() and full malloc().

Good point, will do.

> If you can have it so that the stack top equals the global_data
> bottom, then we should be OK.

Will do that in v6.

> > Note, however, that it will not simplify assembly code: it will turn a
> > subtraction from sp into an assignment to sp, which is not simpler, and
> > it will add an assignment to whatever register represents the first
> > argument, since we'll turn a (void) function into a (ulong top)
> > function, so all in all, it will add one assembly instruction with
> > respect to the 'ulong board_init_f_get_reserve_size(void)' approach.
> 
> True, but now we are just passing values around rather than doing
> arithmetic in assembler.

Well, at the C level an addition may be more complex than an
assignment, but at the assembly level, that's pretty much equally
simple. Anyway, the change is ok by me.

> > gd works at this point, and I want to avoid any aliasing issue.
> 
> I don't really understand that, but if you want to use gd I think it
> would be worth a one-line comment.

I believe it is already present in v5:

+ * ALSO IMPORTANT:
+ *
+ * On some architectures, gd will only be set once arch_setup_gd() is
+ * called. Therefore:
+ *
+ * 	Do not use 'gd->' until arch_setup_gd() has been called!

I will expand that comment a bit, and add a one-liner in the code too.

Thanks again for your comments!

Amicalement,
-- 
Albert.

      reply	other threads:[~2015-11-20 16:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 16:22 [U-Boot] [PATCH v5] Fix board init code to respect the C runtime environment Albert ARIBAUD
2015-11-16 17:25 ` Alexey Brodkin
2015-11-17  4:11 ` Simon Glass
2015-11-17 12:59   ` Albert ARIBAUD
2015-11-17 13:39     ` Albert ARIBAUD
2015-11-19  1:05     ` Simon Glass
2015-11-20 16:26       ` Albert ARIBAUD [this message]

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=20151120172612.49326273@lilith \
    --to=albert.u.boot@aribaud.net \
    --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