From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] ARM: fiq: Refactor {get,set}_fiq_regs() for Thumb-2
Date: Thu, 7 Apr 2011 23:28:13 +0100 [thread overview]
Message-ID: <20110407222813.GF17049@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <BANLkTi=q=A=RBh-mQgZ_4S6NkUJ0O7ERig@mail.gmail.com>
On Thu, Apr 07, 2011 at 11:02:18AM +0100, Dave Martin wrote:
> The main reason for that is to code the ->ARM_r8 in C (as in the
> existing code). I feel safer doing that than hard-coding an offset in
> the assembler, though possibly that is overkill since if the layout of
> struct pt_regs changes we are probably in trouble for all kinds of
> other reasons anyway...
It may be worth looking up exactly what's allowed with naked functions.
A naked function tells the compiler to omit the function prologue and
epologue, which effectively means you can't do very much other than
inline asm in them. So I think we're pretty safe from register
allocation issues.
If the compiler was to do register allocation for ®s->ARM_r8, and it
landed up in r8, then that would not only break the code, but also break
the ABI as the compiler would be unable to save the value of r8.
> I could have used register variables with explicit register
> assignments. Alternatively, I could have added r8-r14 to the clobber
> list -- but then the compiler would generate unnecessary save and
> restore sequences for all those registers.
I doubt it would for a naked function. You're expected to handle
that stuff yourself with such things.
next prev parent reply other threads:[~2011-04-07 22:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.19600.1302086322.1534.linux-arm-kernel@lists.infradead.org>
[not found] ` <alpine.DEB.2.00.1104061208310.15572@localhost6.localdomain6>
2011-04-07 10:02 ` [RFC PATCH] ARM: fiq: Refactor {get,set}_fiq_regs() for Thumb-2 Dave Martin
2011-04-07 11:35 ` Frank Hofmann
2011-04-07 13:58 ` Dave Martin
2011-04-07 14:24 ` Frank Hofmann
2011-04-07 14:29 ` Dave Martin
2011-04-07 22:28 ` Russell King - ARM Linux [this message]
2011-04-08 10:03 ` Dave Martin
2011-04-08 14:20 ` Frank Hofmann
2011-04-06 10:29 Dave Martin
2011-04-06 10:55 ` Dave Martin
2011-04-06 17:37 ` Nicolas Pitre
2011-04-07 9:36 ` Dave Martin
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=20110407222813.GF17049@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).