summaryrefslogtreecommitdiff
path: root/include/common
diff options
context:
space:
mode:
authordavidcunado-arm <david.cunado@arm.com>2017-09-07 00:40:59 +0100
committerGitHub <noreply@github.com>2017-09-07 00:40:59 +0100
commit413115e1529a2c2211bac5d3cd1249070e0a8a88 (patch)
tree552cd80dbdf682f4b17af3c1703db733a48480fb /include/common
parente524d78f9fc904b0e831855145320384e9656a46 (diff)
parent86606eb51e81b4189579e2b429f1c8f26f5c804c (diff)
Merge pull request #1019 from etienne-lms/log-size
CPU_DATA_LOG2SIZE depends on cache line size
Diffstat (limited to 'include/common')
-rw-r--r--include/common/aarch32/asm_macros.S13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/common/aarch32/asm_macros.S b/include/common/aarch32/asm_macros.S
index 3adcbf51..f5737449 100644
--- a/include/common/aarch32/asm_macros.S
+++ b/include/common/aarch32/asm_macros.S
@@ -80,6 +80,19 @@
.endm
/*
+ * Helper macro to generate the best mov/movw/movt combinations
+ * according to the value to be moved.
+ */
+ .macro mov_imm _reg, _val
+ .if ((\_val) & 0xffff0000) == 0
+ mov \_reg, #(\_val)
+ .else
+ movw \_reg, #((\_val) & 0xffff)
+ movt \_reg, #((\_val) >> 16)
+ .endif
+ .endm
+
+ /*
* Macro to mark instances where we're jumping to a function and don't
* expect a return. To provide the function being jumped to with
* additional information, we use 'bl' instruction to jump rather than