From efce79f09ae6daa77cd322df0d532beec3f445f5 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 26 Mar 2008 13:40:36 +0000 Subject: 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. --- libc/string/arm/bcopy.S | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libc/string/arm/bcopy.S') diff --git a/libc/string/arm/bcopy.S b/libc/string/arm/bcopy.S index db3c9e6c1..2d6e90d13 100644 --- a/libc/string/arm/bcopy.S +++ b/libc/string/arm/bcopy.S @@ -40,6 +40,7 @@ /* bcopy = memcpy/memmove with arguments reversed. */ #include +#include #ifdef __UCLIBC_SUSV3_LEGACY__ @@ -48,12 +49,23 @@ .type bcopy,%function .align 4 +#if defined(__thumb__) && !defined(__thumb2__) +.thumb_func +bcopy: + push {r2, lr} + mov ip, r0 + mov r0, r1 + mov r1, ip + bl _memcpy + POP_RET +#else bcopy: /* switch the source and destination registers */ eor r0, r1, r0 eor r1, r0, r1 eor r0, r1, r0 b _memcpy /* (PLT) */ +#endif .size bcopy,.-bcopy -- cgit v1.2.3