From: Julien Grall Date: Mon, 15 Apr 2019 20:58:51 +0000 (+0100) Subject: xen/arm32: head: Add a macro to move an immediate constant into a 32-bit register X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~1642 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=75843a162b84ff02201373d35cd2e72d7a8cca3e;p=xen.git xen/arm32: head: Add a macro to move an immediate constant into a 32-bit register The current boot code is using the pattern ldr rX, =... to move an immediate constant into a 32-bit register. This pattern implies to load the immediate constant from a literal pool, meaning a memory access will be performed. The memory access can be avoided by using movw/movt instructions. A new macro is introduced to move an immediate constant into a 32-bit register without a memory load. Follow-up patches will make use of it. Signed-off-by: Julien Grall Acked-by: Stefano Stabellini --- diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S index 18ded49a04..99f4af18d8 100644 --- a/xen/arch/arm/arm32/head.S +++ b/xen/arch/arm/arm32/head.S @@ -36,6 +36,15 @@ #include EARLY_PRINTK_INC #endif +/* + * Move an immediate constant into a 32-bit register using movw/movt + * instructions. + */ +.macro mov_w reg, word + movw \reg, #:lower16:\word + movt \reg, #:upper16:\word +.endm + /* * Common register usage in this file: * r0 -