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 0/3] ARM: use r9 for gd instead of r8
Date: Mon, 12 Aug 2013 07:49:51 +0200	[thread overview]
Message-ID: <20130812074951.03955711@lilith> (raw)
In-Reply-To: <1569164175.875060.1376258939828.JavaMail.zimbra@advansee.com>

Hi Beno?t,

On Mon, 12 Aug 2013 00:08:59 +0200 (CEST), Beno?t Th?baudeau
<benoit.thebaudeau@advansee.com> wrote:

> Dear Jeroen Hofstee,
> 
> On Sunday, August 11, 2013 10:58:36 PM, Jeroen Hofstee wrote:
> > To be EABI compliant (r9 is a platform specific register) and as
> > a prepration for building u-boot with clang/llvm (with does / will
> > support r9 as reserved register), store the pointer to gd in r9.
> 
> If r9 is reserved, I understand that its current usage may conflict with clang's
> but why would gd have to be stored in r9 for clang? Moreover, if r9 is reserved
> for clang (reserved for what?), why can it be used for gd?

Actually, you have to think about this the other way around:

1. In LLVM/clang, r9 can be reserved, i.e., LLVM/clang can be told to
not touch it at all, because it is the AAPCS platform register.

2. Because r9 is the AAPCS platform register, it is the natural choice
for GD.

> I'm also wondering if r9 as initialized by relocate.S is not sometimes used by
> GCC to handle position-independent code within generated code, i.e. like the
> static base feature described for r9 as a possible usage in the ARM EABI AAPCS
> document (5.1.1). If this is the case, changing r9 to gd would break GCC code at
> runtime.

This would be useful when your code gets moved around several times
during its lifetime, which is not a requirement in U-Boot. We get
perfectly working U-Boot relocation without a base register.

> Best regards,
> Beno?t

Amicalement,
-- 
Albert.

  reply	other threads:[~2013-08-12  5:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-11 20:58 [U-Boot] [PATCH 0/3] ARM: use r9 for gd instead of r8 Jeroen Hofstee
2013-08-11 20:58 ` [U-Boot] [PATCH 1/3] ARM: make reserving the gd register a make variable Jeroen Hofstee
2013-08-11 20:58 ` [U-Boot] [PATCH 2/3] ARM,relocate: do not use r9 Jeroen Hofstee
2013-08-11 20:58 ` [U-Boot] [PATCH 3/3] ARM: use r9 for gd Jeroen Hofstee
2013-08-12  5:53   ` Wolfgang Denk
2013-08-12 14:44     ` Albert ARIBAUD
2013-08-12 15:23       ` Wolfgang Denk
2013-08-13 19:41         ` Jeroen Hofstee
2013-08-11 22:08 ` [U-Boot] [PATCH 0/3] ARM: use r9 for gd instead of r8 Benoît Thébaudeau
2013-08-12  5:49   ` Albert ARIBAUD [this message]
2013-08-13 19:36   ` Jeroen Hofstee
2013-08-14 18:25 ` [U-Boot] [PATCH v2 0/4] " Jeroen Hofstee
2013-08-14 18:25   ` [U-Boot] [PATCH v2 1/4] ARM: make reserving the gd register a make variable Jeroen Hofstee
2013-08-17 13:55     ` Jeroen Hofstee
2013-09-19  6:57       ` Albert ARIBAUD
2013-09-19 16:54         ` Jeroen Hofstee
2013-08-14 18:25   ` [U-Boot] [PATCH v2 2/4] ARM,relocate: do not use r9 Jeroen Hofstee
2013-08-14 18:25   ` [U-Boot] [PATCH v2 3/4] ARM: use r9 for gd Jeroen Hofstee
2013-08-17  9:40     ` Jeroen Hofstee
2013-08-17 13:51       ` Jeroen Hofstee
2013-08-19  3:08       ` Simon Glass
2013-08-19 17:32         ` Jeroen Hofstee
2013-08-21 16:22           ` Jeroen Hofstee
2013-08-21 23:44             ` Simon Glass
2013-08-14 18:25   ` [U-Boot] [PATCH v2 4/4] README: update ARM register usage Jeroen Hofstee
2013-09-21 12:04 ` [U-Boot] [PATCH v3 0/3] ARM: use r9 for gd instead of r8 Jeroen Hofstee
2013-09-21 12:04   ` [U-Boot] [PATCH v3 1/3] ARM,relocate: do not use r9 Jeroen Hofstee
2013-09-21 12:04   ` [U-Boot] [PATCH v3 2/3] ARM: use r9 for gd Jeroen Hofstee
2013-09-21 15:30     ` Jeroen Hofstee
2013-09-21 12:04   ` [U-Boot] [PATCH v3 3/3] README: update ARM register usage Jeroen Hofstee
2013-09-23 16:56   ` [U-Boot] [PATCH v3 0/3] ARM: use r9 for gd instead of r8 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=20130812074951.03955711@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