Thread (28 messages) 28 messages, 6 authors, 2014-02-03

[PATCH v4 2/5] arm: add new asm macro update_sctlr

From: Will Deacon <hidden>
Date: 2014-02-03 16:01:45
Also in: linux-efi, lkml

On Mon, Feb 03, 2014 at 03:55:42PM +0000, Leif Lindholm wrote:
On Mon, Feb 03, 2014 at 10:34:15AM +0000, Will Deacon wrote:
quoted
On Thu, Jan 30, 2014 at 01:12:47PM +0000, Leif Lindholm wrote:
quoted
Oh, that's neat - thanks!

Well, given that, I can think of two less horrible options:
1)
	.macro  update_sctlr, tmp:req, set=, clear=
        mrc	p15, 0, \tmp, c1, c0, 0
	.ifnc	\set,
        orr	\tmp, \set
	.endif
	.ifnc	\clear,
	mvn	\clear, \clear
	and	\tmp, \tmp, \clear
Can't you use bic here?
Yeah.
quoted
quoted
	.endif
        mcr	p15, 0, \tmp, c1, c0, 0
	.endm

With the two call sites in uefi_phys.S as:

	ldr	r5, =(CR_M)
	update_sctlr	r12, , r5
and
	ldr	r4, =(CR_I | CR_C | CR_M)
	update_sctlr	r12, r4
These ldr= could be movs, right?
The first one could.
The second one could be movw on armv7+.
quoted
If so, I definitely prefer this to putting an ldr = into the macro itself
(option 2).
And your preference between 1) and 2) is?
(1), using bic and mov[tw] where possible.

Will
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help