From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ard Biesheuvel Subject: [RFC PATCH 03/10] arm64: add macros to emit little endian ASM constants Date: Mon, 21 Jul 2014 17:16:18 +0200 Message-ID: <1405955785-13477-4-git-send-email-ard.biesheuvel@linaro.org> References: <1405955785-13477-1-git-send-email-ard.biesheuvel@linaro.org> Return-path: In-Reply-To: <1405955785-13477-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, will.deacon-5wv7dgnIgG8@public.gmane.org, leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org Cc: roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, victor.kamensky-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, steve.capper-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, Ard Biesheuvel List-Id: linux-efi@vger.kernel.org The Image header contains many constants that should be emitted in little endian regardless of the endianness of the kernel. Add helper macros le16, le32 and le64 to to aid with this. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/assembler.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index 5901480bfdca..7db7c946f73f 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -155,3 +155,21 @@ lr .req x30 // link register #endif orr \rd, \lbits, \hbits, lsl #32 .endm + + /* + * Define LE constants + */ + .macro le16, x + .byte \x & 0xff + .byte (\x >> 8) & 0xff + .endm + + .macro le32, x + le16 \x + le16 \x >> 16 + .endm + + .macro le64, x + le32 \x + le32 \x >> 32 + .endm -- 1.8.3.2