diff options
author | davidcunado-arm <david.cunado@arm.com> | 2017-06-26 09:54:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-26 09:54:24 +0100 |
commit | ccf3911108ea817a53f6e3b33526881d397ef442 (patch) | |
tree | e3ad11342a503d2b3d25a9c21c8da47280b57e45 /lib | |
parent | 73e11b4321fa8b0d7032175e1ddf65a4a320847c (diff) | |
parent | 3ec5204c49ddbc5c1142eda28106a572ca9ed9eb (diff) |
Merge pull request #994 from soby-mathew/sm/fwu_fix
Fix FWU and cache helper optimization
Diffstat (limited to 'lib')
-rw-r--r-- | lib/aarch32/cache_helpers.S | 4 | ||||
-rw-r--r-- | lib/aarch64/cache_helpers.S | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/aarch32/cache_helpers.S b/lib/aarch32/cache_helpers.S index 57b6b384..810af0f0 100644 --- a/lib/aarch32/cache_helpers.S +++ b/lib/aarch32/cache_helpers.S @@ -20,6 +20,9 @@ * This macro can be used for implementing various data cache operations `op` */ .macro do_dcache_maintenance_by_mva op, coproc, opc1, CRn, CRm, opc2 + /* Exit early if size is zero */ + cmp r1, #0 + beq exit_loop_\op dcache_line_size r2, r3 add r1, r0, r1 sub r3, r2, #1 @@ -30,6 +33,7 @@ loop_\op: cmp r0, r1 blo loop_\op dsb sy +exit_loop_\op: bx lr .endm 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 /* ------------------------------------------ |