Skip to content
Snippets Groups Projects
Commit ba08afe8 authored by Klaus Goger's avatar Klaus Goger Committed by Tom Rini
Browse files

arm: Make arch specific memcpy thumb-safe.


The current arch implementation of memcpy cannot be called
from thumb code, because it does not use bx instructions on return.
This patch addresses that. Note, that this patch does not touch
the hot loop of memcpy, so performance is not affected.

Tested on MXS (arm926ejs) with and without thumb-mode enabled.

Signed-off-by: default avatarKlaus Goger <klaus.goger@theobroma-systems.com>
Signed-off-by: default avatarChristoph Muellner <christoph.muellner@theobroma-systems.com>
parent f41a824b
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,7 @@
#endif
ENTRY(memcpy)
cmp r0, r1
moveq pc, lr
bxeq lr
enter r4, lr
......@@ -147,7 +147,8 @@ ENTRY(memcpy)
str1b r0, r4, cs, abort=21f
str1b r0, ip, cs, abort=21f
exit r4, pc
exit r4, lr
bx lr
9: rsb ip, ip, #4
cmp ip, #2
......@@ -256,7 +257,8 @@ ENTRY(memcpy)
.endm
.macro copy_abort_end
ldmfd sp!, {r4, pc}
ldmfd sp!, {r4, lr}
bx lr
.endm
ENDPROC(memcpy)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment