public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Rafal Jaworowski <raj@semihalf.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] PPC: Use r2 instead of r29 as global data pointer
Date: Sun, 17 Feb 2008 17:20:31 +0100	[thread overview]
Message-ID: <47B85ECF.5080207@semihalf.com> (raw)
In-Reply-To: <1203027282-22398-1-git-send-email-wd@denx.de>

Hello Wolfgang,
you wrote:
> R29 was an unlucky choice as with recent toolchains (gcc-4.2.x) gcc
> will refuse to use load/store multiple insns; instead, it issues a
> list of simple load/store instructions upon function entry and exit,
> resulting in bigger code size, which in turn makes the build for a
> few boards fail.
> 
> Use r2 instead.
> 

How about switching r14 (GOT ptr) to r13 in a similar way? Quite like the r2,
r13 is a dedicated register (small data area purposes) and it would let us
avoid using the -ffixed completely.

This would also resolve a general problem with standalone applications that is
lurking in the dark: the global data and GOT pointers are not saved/restored
upon exception/interrupt, so for example, upon a decrementer hit U-Boot code
starts using the dedicated regs blindly, but they could be scratched by the
app's code that was interrupted. This doesn't surface with the U-Boot in-tree
example applications, as they are built using system config.mk and contain
proper -ffixed tweaks and happen to be in sync, but this a general problem,
which should be addressed, as is biting applications built outside of U-Boot
tree..

If we used another dedicated register for GOT purposes, which applications
code would never use by definition, those issues dissapear. Otherwise we need
to provide explicit save/restore in the exception prologue/epilogue.

I can provide patches, but let me know your thoughts first.

kind regards,
Rafal

  reply	other threads:[~2008-02-17 16:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-14 22:14 [U-Boot-Users] [PATCH] PPC: Use r2 instead of r29 as global data pointer Wolfgang Denk
2008-02-17 16:20 ` Rafal Jaworowski [this message]
2008-02-17 22:05   ` Wolfgang Denk

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=47B85ECF.5080207@semihalf.com \
    --to=raj@semihalf.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