summaryrefslogtreecommitdiff
path: root/libc/string/arm/memcpy.S
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-03-26 13:40:36 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-03-26 13:40:36 +0000
commitefce79f09ae6daa77cd322df0d532beec3f445f5 (patch)
treeae936850c5671b8bea0abf0d33bf2196f7abc796 /libc/string/arm/memcpy.S
parent17e961d9c708ab202760ce830f8efe73e91bb129 (diff)
Paul Brook writes:
The attached patch adds support for compiling arm uClibc as pure Thumb code. This is needed because some recent ARM codes do not implement traditional ARM mode. Specifically: * Cortex-M1 - An extremely minimal FPGA based core that only implements Thumb-1 (aka ARMv6-M). * Cortex-M3 - A Thumb-2 only ARMv7-M core. Most of uClibc already builds in Thumb mode, all that is left are a handful of assembly bits. Tested on arm-uclinuxeabi.
Diffstat (limited to 'libc/string/arm/memcpy.S')
-rw-r--r--libc/string/arm/memcpy.S11
1 files changed, 9 insertions, 2 deletions
diff --git a/libc/string/arm/memcpy.S b/libc/string/arm/memcpy.S
index 7a5b6ab76..d2013d211 100644
--- a/libc/string/arm/memcpy.S
+++ b/libc/string/arm/memcpy.S
@@ -38,16 +38,23 @@
*/
#include <features.h>
+#include <bits/arm_asm.h>
.text
.global memcpy
.type memcpy,%function
.align 4
+#if defined(__thumb__) && !defined(__thumb2__)
+.thumb_func
memcpy:
- stmfd sp!, {r0, lr}
+ push {r0, lr}
bl _memcpy
- ldmfd sp!, {r0, pc}
+ POP_RET
+#else
+memcpy:
+ b _memcpy
+#endif
.size memcpy,.-memcpy