aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Leach <matthew.leach@arm.com>2013-10-11 14:52:15 +0100
committerVictor Kamensky <victor.kamensky@linaro.org>2014-03-13 18:28:01 -0700
commit68a8504b75607ca83ad5e665727d4bfd19c3dd42 (patch)
treed2b5d4c2dfba3f6b98116219fe1ee44f72fd4a2b
parent5cf270ce3fbe6e8c493bce717418c62c00db13b3 (diff)
arm64: asm: add CPU_LE & CPU_BE assembler helpers
Add CPU_LE and CPU_BE to select assembler code in little and big endian configurations respectively. Signed-off-by: Matthew Leach <matthew.leach@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> (cherry picked from commit e68bedaa03c950ae8045e7899e7a6b2a97d1bf41) Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
-rw-r--r--arch/arm64/include/asm/assembler.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index 381b935e74cd..fd3e3924041b 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -115,6 +115,25 @@ lr .req x30 // link register
.align 7
b \label
.endm
+
+/*
+ * Select code when configured for BE.
+ */
+#ifdef CONFIG_CPU_BIG_ENDIAN
+#define CPU_BE(code...) code
+#else
+#define CPU_BE(code...)
+#endif
+
+/*
+ * Select code when configured for LE.
+ */
+#ifdef CONFIG_CPU_BIG_ENDIAN
+#define CPU_LE(code...)
+#else
+#define CPU_LE(code...) code
+#endif
+
/*
* Define a macro that constructs a 64-bit value by concatenating two
* 32-bit registers. Note that on big endian systems the order of the