diff options
author | Matthew Leach <matthew.leach@arm.com> | 2013-10-11 13:52:13 (GMT) |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2013-10-25 14:59:36 (GMT) |
commit | 55b89540b0d8d031f90e3d711ec0df3f797ecc61 (patch) | |
tree | 15ca21914bc853fcafa3b549a2e66d316e205434 /arch/arm64/include | |
parent | a795a38eb91cf72c4a05e72a9c84e317ee179a48 (diff) | |
download | linux-55b89540b0d8d031f90e3d711ec0df3f797ecc61.tar.xz |
arm64: compat: correct register concatenation for syscall wrappers
The arm64 port contains wrappers for arm32 syscalls that pass 64-bit
values. These wrappers concatenate the two registers to hold a 64-bit
value in a single X register. On BE, however, the lower and higher
words are swapped.
Create a new assembler macro, regs_to_64, that when on BE systems
swaps the registers in the orr instruction.
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Matthew Leach <matthew.leach@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r-- | arch/arm64/include/asm/assembler.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index 5aceb83..381b935 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -115,3 +115,15 @@ lr .req x30 // link register .align 7 b \label .endm +/* + * 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 + * registers is swapped. + */ +#ifndef CONFIG_CPU_BIG_ENDIAN + .macro regs_to_64, rd, lbits, hbits +#else + .macro regs_to_64, rd, hbits, lbits +#endif + orr \rd, \lbits, \hbits, lsl #32 + .endm |