From: Alessandro Rubini <rubini-list@gnudd.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: Tegra2: add support for A9 CPU init
Date: Thu, 17 Mar 2011 16:30:38 +0100 [thread overview]
Message-ID: <20110317153038.GA16665@mail.gnudd.com> (raw)
In-Reply-To: <AANLkTim=HaVyD7Nudwf7__8nu9u-bNS-3AkOktSF-3Db@mail.gmail.com>
>> It looks like most of your uses are standalone functions that would
>> function just fine on their own. Is there a reason you prefer to have
>> them in a C-file instead of in an assembly file?
> Just laziness ;)
> I'll move these to a new .S file in the next patchset.
Actually, writing assembly-only C functions is difficul and
error-pronet. I've seen you use "r0" and other registers esplicitly,
but this is not allowed in general.
I once wasted some hours in tracking why a non-submitted port of
u-boot was not working with a newer compiler. The problem was just
that: the new compiler was inlining a void(void) function; the asm
used "r0" and "r1" explicitly, which worked over a function call
but was corrupting data when inlined by the newer and more optimizing
compiler.
While your functions are currently not inlined (or, like cold_boot,
they may be inlined in a place where no register needs to be
preserved), another user may move them to a context where the
semantics are different, for another board or another boot loader. If
they are in a .S files, they will only be called by "bl" and you know
the rules for register allocation appy. Besides, a _real_ lazy
programmer avoids the extra quotes and \n in the code :)
/alessandro
next prev parent reply other threads:[~2011-03-17 15:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-16 20:26 [U-Boot] [PATCH] Add A9 CPU complex support Tom Warren
2011-02-16 20:26 ` [U-Boot] [PATCH] arm: Tegra2: add support for A9 CPU init Tom Warren
2011-02-22 23:41 ` Tom Warren
2011-02-22 23:57 ` Albert ARIBAUD
2011-02-23 15:50 ` Tom Warren
2011-03-07 16:15 ` Tom Warren
2011-03-13 17:46 ` Albert ARIBAUD
2011-03-14 16:15 ` Tom Warren
2011-03-14 15:33 ` Peter Tyser
2011-03-14 21:16 ` Tom Warren
2011-03-14 22:20 ` Peter Tyser
2011-03-14 23:08 ` Tom Warren
2011-03-17 14:32 ` Peter Tyser
2011-03-18 18:06 ` Tom Warren
2011-03-17 15:30 ` Alessandro Rubini [this message]
2011-03-18 18:16 ` Tom Warren
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=20110317153038.GA16665@mail.gnudd.com \
--to=rubini-list@gnudd.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