From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/5] arm: add new asm macro update_sctlr
Date: Wed, 22 Jan 2014 11:20:55 +0000 [thread overview]
Message-ID: <20140122112055.GF1621@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <1389445524-30623-3-git-send-email-leif.lindholm@linaro.org>
On Sat, Jan 11, 2014 at 01:05:21PM +0000, Leif Lindholm wrote:
> A new macro for setting/clearing bits in the SCTLR.
>
> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
> Suggested-by: Will Deacon <will.deacon@arm.com>
> ---
> arch/arm/include/asm/assembler.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
> index 5c22851..aba6458 100644
> --- a/arch/arm/include/asm/assembler.h
> +++ b/arch/arm/include/asm/assembler.h
> @@ -383,4 +383,17 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
> #endif
> .endm
>
> +#ifdef CONFIG_CPU_CP15
> +/* Macro for setting/clearing bits in sctlr */
> + .macro update_sctlr, set:req, clear:req, tmp:req, tmp2:req
> + mrc p15, 0, \tmp, c1, c0, 0
> + ldr \tmp2, =\set
> + orr \tmp, \tmp, \tmp2
> + ldr \tmp2, =\clear
> + mvn \tmp2, \tmp2
> + and \tmp, \tmp, \tmp2
> + mcr p15, 0, \tmp, c1, c0, 0
I think this would be cleaner if you force the caller to put set and clear
into registers beforehand, rather than have to do the literal load every
time. Also, I don't think set and clear should be required (and then you can
lose tmp2 as well).
Will
next prev parent reply other threads:[~2014-01-22 11:20 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-11 13:05 [PATCH v4 0/5] arm: add UEFI runtime services support Leif Lindholm
2014-01-11 13:05 ` [PATCH v4 1/5] arm: break part of __soft_restart out into separate function Leif Lindholm
2014-01-22 11:09 ` Will Deacon
2014-01-11 13:05 ` [PATCH v4 2/5] arm: add new asm macro update_sctlr Leif Lindholm
2014-01-22 11:20 ` Will Deacon [this message]
2014-01-29 18:28 ` Leif Lindholm
2014-01-29 19:27 ` Will Deacon
2014-01-29 20:58 ` Mark Salter
2014-01-30 13:12 ` Leif Lindholm
2014-02-03 10:34 ` Will Deacon
2014-02-03 15:55 ` Leif Lindholm
2014-02-03 16:00 ` Will Deacon
2014-02-03 16:20 ` Rob Herring
2014-02-03 16:46 ` Leif Lindholm
2014-02-03 16:57 ` Will Deacon
2014-02-03 18:15 ` Leif Lindholm
2014-01-11 13:05 ` [PATCH v4 3/5] Documentation: arm: add UEFI support documentation Leif Lindholm
2014-01-11 13:05 ` [PATCH v4 4/5] arm: Add [U]EFI runtime services support Leif Lindholm
2014-01-13 15:40 ` Matt Fleming
2014-01-13 18:43 ` Arnd Bergmann
2014-01-13 20:01 ` Leif Lindholm
2014-01-14 6:52 ` Arnd Bergmann
2014-01-14 11:44 ` Leif Lindholm
2014-01-14 13:26 ` Arnd Bergmann
2014-01-14 15:25 ` Leif Lindholm
2014-01-11 13:05 ` [PATCH v4 5/5] init: efi: arm: enable (U)EFI runtime services on arm Leif Lindholm
2014-01-13 18:29 ` Arnd Bergmann
2014-01-13 18:57 ` Leif Lindholm
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=20140122112055.GF1621@mudshark.cambridge.arm.com \
--to=will.deacon@arm.com \
--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).