]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ARM: 7510/1: opcodes: Add helpers for emitting custom opcodes
authorDave Martin <dave.martin@linaro.org>
Mon, 3 Sep 2012 12:49:24 +0000 (13:49 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 7 Sep 2012 19:35:33 +0000 (20:35 +0100)
commit41f1a798f3b05dc54e38f308c92f9481c2f6d91d
treed3dc6d853007176bee56840b6396f90e9f4b3d6f
parentc4c2041a7ee668368d81502cb1c1e6ea86bf9d0c
ARM: 7510/1: opcodes: Add helpers for emitting custom opcodes

This patch adds some __inst_() macros for injecting custom opcodes
in assembler (both inline and in .S files).  They should make it
easier and cleaner to get things right in little-/big-
endian/ARM/Thumb-2 kernels without a lot of #ifdefs.

This pure-preprocessor approach is preferred over the alternative
method of wedging extra assembler directives into the assembler
input using top-level asm() blocks, since there is no way to
guarantee that the compiler won't reorder those with respect to
each other or with respect to non-toplevel asm() blocks, unless
-fno-toplevel-reorder is passed (which is in itself somewhat
undesirable because it defeats some potential optimisations).

Currently <asm/unified.h> _does_ silently rely on the compiler not
reordering at the top level, but it seems better to avoid adding
extra code which depends on this if the same result can be achieved
in another way.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/opcodes.h