]> 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>
Sat, 15 Sep 2012 20:25:57 +0000 (21:25 +0100)
commita61a41a01822d48bbe53e6c1df56b88ee2f3de34
tree6cddc5d2834588e739f76e26d8befdbbb4aebba0
parent0ce3de23f2a520a6ac8c2179fb8f88342c4992ef
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