public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH] arm: provide a CONFIG flag for disabling relocation
Date: Wed, 21 Sep 2011 14:31:24 +0200	[thread overview]
Message-ID: <4E79D91C.8070008@gmail.com> (raw)
In-Reply-To: <4E79D27D.30409@aribaud.net>

Dear Albert,

Am Mi 21 Sep 2011 14:03:09 CEST schrieb Albert ARIBAUD:
> Le 21/09/2011 13:20, Andreas Bie?mann a ?crit :
>> Dear "GROYER, Anthony",
>> Dear Albert,
>>
>> Am Mi 21 Sep 2011 12:51:33 CEST schrieb Albert ARIBAUD:
>>> Le 21/09/2011 11:29, GROYER, Anthony a ?crit :
>>>
>>
>> <snip>
>>
>>> 3) replace use of r9-r10 with e.g. r10-r11 in the copy loop, to
>>> preserve
>>> r9 during relocation.
>>
>> If one is changing this place I would like to discuss another point
>> here.
>> In my last changeset for relocation I found some implementation in
>> a/a/c/pxa/start.S which do save the register to stack before copy_loop,
>> use almost all registers (only r8 is not used which is gd_t for arm, but
>> I think it could be used here too cause it is saved on the stack) and
>> save the registers back later on.
>> I guess this could fasten the copy_loop a bit but needs to be proven.
>> Anthony, if you change all start.S could you consider this also?
>
> I am not 100% sure I get your point, but I assume that you are asking
> for *removal* of the saving and restoring, right?

No, that was not the point. I think the 'save registers before copy_loop
to use more registers for ldmia/stmia instructions' is a good solution
which could improve the copy_loop for all arm implementations.

> I would tend to
> agree that saving and restoring registers in relocate_code is moot, as
> this function does not return in the usual sense.

No the code does register save before copy_loop and restore them right
afterwards. Therefore even r8 could be used in the copy_loop cause it is
preserved on the (newly created) stack. Have a look at a/a/c/pxa/start.S
from line 241 (relocate_code) to 263 (end of copy_loop).
But I guess the ldmia/stmia instructions could even use r3-r11, only
r0-r2 needs to be preserved for loop counting.
I wonder if this could improve the copy_loop ... will try to test it
these days, if no one else can do it (Anthony?).

> As for r8, it should be preserved as it points to gd, but that is
> ensured by the C code already IIRC.

We use -ffixed-r8 therefore the compiler takes care for the C part, but
we need to respect this in asm.

Well, if we preserve r8 for the copy_loop and restore it right
afterwards we could use it in the copy_loop for copy purposes. Cause
there is no dereferencing of r8 in copy_loop.

best regards

Andreas Bie?mann

  reply	other threads:[~2011-09-21 12:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20 14:22 [U-Boot] [RFC PATCH] arm: provide a CONFIG flag for disabling relocation GROYER, Anthony
2011-09-20 18:09 ` Wolfgang Denk
2011-09-20 19:13   ` Albert ARIBAUD
2011-09-21  9:29     ` GROYER, Anthony
2011-09-21 10:45       ` Wolfgang Denk
2011-09-21 11:44         ` Albert ARIBAUD
2011-09-21 10:51       ` Albert ARIBAUD
2011-09-21 11:20         ` Andreas Bießmann
2011-09-21 12:03           ` Albert ARIBAUD
2011-09-21 12:31             ` Andreas Bießmann [this message]
2011-09-21 14:23               ` Albert ARIBAUD
2011-09-22  7:10                 ` Andreas Bießmann
2011-09-29 16:14               ` Andreas Bießmann
2011-09-30  7:21                 ` Simon Schwarz
2011-10-01  6:48                   ` Albert ARIBAUD
2011-09-20 21:34 ` Simon Glass
2011-09-21 14:21   ` Aneesh V
2011-09-23 16:04     ` Simon Glass
2011-10-01  7:01       ` Albert ARIBAUD
2011-10-03  3:34         ` Simon Glass
  -- strict thread matches above, loose matches on Subject: below --
2011-03-25 13:12 Aneesh V
2011-03-25 13:27 ` Aneesh V
2011-03-25 14:12 ` Wolfgang Denk
2011-03-25 16:12   ` Aneesh V
2011-03-25 18:35     ` Albert ARIBAUD
2011-04-20 18:34       ` Simon Glass
2011-04-21  6:56         ` Aneesh V
2011-04-21 15:18           ` Simon Glass

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=4E79D91C.8070008@gmail.com \
    --to=andreas.devel@googlemail.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