public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH RFC 2/3] arm920t: do not use r8 for relocation
Date: Tue, 30 Nov 2010 09:58:20 +0100	[thread overview]
Message-ID: <4CF4BCAC.9050409@aribaud.net> (raw)
In-Reply-To: <4CF4B753.3020707@gmail.com>

Le 30/11/2010 09:35, Andreas Bie?mann a ?crit :
> Dear Albert ARIBAUD,
>
> Am 30.11.2010 09:22, schrieb Albert ARIBAUD:
>> Le 30/11/2010 08:06, Andreas Bie?mann a ?crit :
>>> r8 is used for gd and should therefore be left alone
>>
>> I'm surprised that this did not break things so far... Whatever value r8
>> ended with was used as the address of GD.
>
> Well r8 is set in arch/arm/include/asm/global_data.h
>
> ---8<---
> #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r8")
> --->8---
>
> The GD is then later on allocated in board_init_f
>
> ---8<---
> 	/* Pointer is writable since we allocated a register for it */
> 	gd = (gd_t *) (CONFIG_SYS_INIT_SP_ADDR);
> 	/* compiler optimization barrier needed for GCC>= 3.4 */
> 	__asm__ __volatile__("": : :"memory");
>
> 	memset ((void*)gd, 0, sizeof (gd_t));
> --->8---

... which is why I could not find "r8" allocation :) ... Thanks. So yes, 
we need to keep r8, and yes, we were lucky that the start.S code did run 
at all with a corrupted r8 -- fixing that may remove some weird 
behaviors we could see,

Can you do a pass on other ARM archs which must be fixed too?

>> I'd like to see a less ambiguous comment here, but I'm not sure what's
>> best. Any suggestions?
>
> Not currently, this was just slipped in by fast preperation of that patch.
>
>>>    fixnext:
>>> -    str    r1, [r0]
>>> +    str    r1, [r0]        /* store back content of r1 */
>>
>> Nak. This comment paraphrases the instruction.
>
> dito

I'd rather have no comment than a paraphrase of the code, but I'd rather 
have an imperfect yet at least partly helpful comment than no comment at 
all for assembly language code.

> regards
>
> Andreas Bie?mann

Amicalement,
-- 
Albert.

  reply	other threads:[~2010-11-30  8:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-29 19:58 [U-Boot] Try to fix Board eb_cpux9k2 Jens Scharsig
2010-11-30  7:06 ` [U-Boot] [PATCH RFC 0/3] chenages to arm relocation Andreas Bießmann
2010-11-30  7:06   ` [U-Boot] [PATCH RFC 1/3] arm920t: do not set register useless Andreas Bießmann
2010-11-30  8:07     ` Albert ARIBAUD
2010-11-30  8:28       ` Andreas Bießmann
2010-11-30  9:25         ` Albert ARIBAUD
2010-11-30  7:06   ` [U-Boot] [PATCH RFC 2/3] arm920t: do not use r8 for relocation Andreas Bießmann
2010-11-30  8:22     ` Albert ARIBAUD
2010-11-30  8:35       ` Andreas Bießmann
2010-11-30  8:58         ` Albert ARIBAUD [this message]
2010-11-30  7:06   ` [U-Boot] [PATCH RFC 3/3] arm920t: do not relocate NULL pointer Andreas Bießmann
2010-11-30  8:32     ` Albert ARIBAUD
2010-11-30  8:47       ` Joakim Tjernlund
2010-11-30  8:50         ` Andreas Bießmann
2010-11-30  9:02         ` Albert ARIBAUD
2010-11-30  9:41           ` Joakim Tjernlund
2010-11-30 11:48             ` Andreas Bießmann
2010-11-30 11:56               ` Joakim Tjernlund
2010-11-30  8:37 ` [U-Boot] Try to fix Board eb_cpux9k2 Albert ARIBAUD
2010-12-02 20:27   ` Jens Scharsig
2010-12-02 20:49     ` Albert ARIBAUD
2010-12-01  6:44 ` Albert ARIBAUD

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=4CF4BCAC.9050409@aribaud.net \
    --to=albert@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