All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] ARM: Unify const-swabbing and conditional asm
@ 2013-10-09 14:29 Dave Martin
  2013-10-09 14:29 ` [RFC PATCH 1/4] ARM: Allow assembler.h to be used with inline asm Dave Martin
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Dave Martin @ 2013-10-09 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

There are a few things in assembler.h that would be useful with
inline asm, but currently assembler.h refuses to be included into C
files.

This refactoring provides a place to put const swabbing helpers, which
can then be used in inline asm and other places (I recycle and share
the code from <asm/opcodes.h>).

The final patch modifies the CCI driver to use the new
__asm_cpu_to_le32() helper, based closely on Victor Kamensky's recent
fix for BE8.  This allows us to avoid some unneeded ifdeffery.


Comments?


These patches are untested, but I have build-tested the CCI driver in
LE and BE32 configurations, which produces the following change in the
generated code:

 e0400001 	sub	r0, r0, r1
 e5900004 	ldr	r0, [r0, #4]
-e3a03003 	mov	r3, #3
+e3a03403 	mov	r3, #50331648	; 0x3000000
 e5803000 	str	r3, [r0]
 e28f1024 	add	r1, pc, #36	; 0x24
 e5910000 	ldr	r0, [r1]
 e7900001 	ldr	r0, [r0, r1]
 e590100c 	ldr	r1, [r0, #12]
-e3110001 	tst	r1, #1
+e3110401 	tst	r1, #16777216	; 0x1000000
 1afffffc 	bne	288 <cci_port_not_found+0x44>
 e3a00000 	mov	r0, #0
 e12fff1e 	bx	lr


Dave Martin (4):
  ARM: Allow assembler.h to be used with inline asm
  ARM: Add common compile-time swab32 for asm code
  ARM: Add const cpu_to_le32 for asm
  drivers/bus: arm-cci: Fix CCI enable code for BE32

 arch/arm/include/asm/assembler.h |   41 ++++++++++++++++++++++++++++++++++----
 arch/arm/include/asm/opcodes.h   |    9 +++------
 drivers/bus/arm-cci.c            |    6 ++++--
 3 files changed, 44 insertions(+), 12 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <20131009161006.GC2306@localhost.localdomain>]
[parent not found: <20131009171202.GD2306@localhost.localdomain>]

end of thread, other threads:[~2013-10-09 17:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-09 14:29 [RFC PATCH 0/4] ARM: Unify const-swabbing and conditional asm Dave Martin
2013-10-09 14:29 ` [RFC PATCH 1/4] ARM: Allow assembler.h to be used with inline asm Dave Martin
2013-10-09 14:42   ` Russell King - ARM Linux
2013-10-09 15:00     ` Dave Martin
2013-10-09 15:32       ` Nicolas Pitre
2013-10-09 14:29 ` [RFC PATCH 2/4] ARM: Add common compile-time swab32 for asm code Dave Martin
2013-10-09 14:29 ` [RFC PATCH 3/4] ARM: Add const cpu_to_le32 for asm Dave Martin
2013-10-09 14:29 ` [RFC PATCH 4/4] drivers/bus: arm-cci: Fix CCI enable code for BE32 Dave Martin
     [not found] <20131009161006.GC2306@localhost.localdomain>
2013-10-09 16:54 ` [RFC PATCH 1/4] ARM: Allow assembler.h to be used with inline asm Nicolas Pitre
     [not found] <20131009171202.GD2306@localhost.localdomain>
2013-10-09 17:27 ` Nicolas Pitre

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.