summaryrefslogtreecommitdiff
path: root/lib/aarch64
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2017-06-15 16:18:45 +0100
committerSoby Mathew <soby.mathew@arm.com>2017-06-21 17:46:28 +0100
commit3ec5204c49ddbc5c1142eda28106a572ca9ed9eb (patch)
tree77c90aae959402fa221e6aace7b744a6ab9d0ca2 /lib/aarch64
parentee05ae168061d713129affb93f4d275ff7a0d1d6 (diff)
Exit early if size zero for cache helpers
This patch enables cache helper functions `flush_dcache_range`, `clean_dcache_range` and `invalidate_dcache_range` to exit early if the size argument specified is zero Change-Id: I0b63e8f4bd3d47ec08bf2a0b0b9a7ff8a269a9b0 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Diffstat (limited to 'lib/aarch64')
-rw-r--r--lib/aarch64/cache_helpers.S3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/aarch64/cache_helpers.S b/lib/aarch64/cache_helpers.S
index eef07a8b..9c40b9db 100644
--- a/lib/aarch64/cache_helpers.S
+++ b/lib/aarch64/cache_helpers.S
@@ -20,6 +20,8 @@
* This macro can be used for implementing various data cache operations `op`
*/
.macro do_dcache_maintenance_by_mva op
+ /* Exit early if size is zero */
+ cbz x1, exit_loop_\op
dcache_line_size x2, x3
add x1, x0, x1
sub x3, x2, #1
@@ -30,6 +32,7 @@ loop_\op:
cmp x0, x1
b.lo loop_\op
dsb sy
+exit_loop_\op:
ret
.endm
/* ------------------------------------------