Commit e68bedaa authored by Matthew Leach's avatar Matthew Leach Committed by Catalin Marinas

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: default avatarMatthew Leach <matthew.leach@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent a1d5ebaf
...@@ -115,6 +115,25 @@ lr .req x30 // link register ...@@ -115,6 +115,25 @@ lr .req x30 // link register
.align 7 .align 7
b \label b \label
.endm .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 * 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 * 32-bit registers. Note that on big endian systems the order of the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment