• Dave Martin's avatar
    ARM: 7510/1: opcodes: Add helpers for emitting custom opcodes · a61a41a0
    Dave Martin authored
    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: default avatarDave Martin <dave.martin@linaro.org>
    Acked-by: default avatarNicolas Pitre <nico@linaro.org>
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    a61a41a0
opcodes.h 7.97 KB