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 <julien.grall@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Julien Grall committed 2019-09-07 12:09:58 +01:00
1 parent 6bdb436440
commit 75843a162b
1 file changed
+9
+9
View File
@@ -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 -
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.