ARM: Correct BUG() assembly to ensure it is endian-agnostic
authorBen Dooks <ben.dooks@codethink.co.uk>
Thu, 25 Jul 2013 13:38:03 +0000 (14:38 +0100)
committerVictor Kamensky <victor.kamensky@linaro.org>
Thu, 13 Mar 2014 21:48:37 +0000 (14:48 -0700)
commit56cbe5efe6f28a7efb459620281717fd7c109e05
tree972a35b7ca7530de98d9e86c119bb7b00161f818
parent9884db0b95b316311fc47dcc9456b6d678631e27
ARM: Correct BUG() assembly to ensure it is endian-agnostic

Currently BUG() uses .word or .hword to create the necessary illegal
instructions. However if we are building BE8 then these get swapped
by the linker into different illegal instructions in the text. This
means that the BUG() macro does not get trapped properly.

Change to using <asm/opcodes.h> to provide the necessary ARM instruction
building as we cannot rely on gcc/gas having the `.inst` instructions
which where added to try and resolve this issue (reported by Dave Martin
<Dave.Martin@arm.com>).

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
(cherry picked from commit 63328070eff2f4fd730c86966a0dbc976147c39f)

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
arch/arm/include/asm/bug.h
arch/arm/kernel/traps.c