diff options
Diffstat (limited to 'libc/string/arm')
-rw-r--r-- | libc/string/arm/Makefile | 6 | ||||
-rw-r--r-- | libc/string/arm/Makefile.arch | 27 | ||||
-rw-r--r-- | libc/string/arm/_memcpy.S | 19 | ||||
-rw-r--r-- | libc/string/arm/bcopy.S | 13 | ||||
-rw-r--r-- | libc/string/arm/bzero.S | 13 | ||||
-rw-r--r-- | libc/string/arm/memcmp.S | 24 | ||||
-rw-r--r-- | libc/string/arm/memcpy.S | 11 | ||||
-rw-r--r-- | libc/string/arm/memmove.S | 11 | ||||
-rw-r--r-- | libc/string/arm/memset.S | 23 | ||||
-rw-r--r-- | libc/string/arm/strcmp.S | 21 | ||||
-rw-r--r-- | libc/string/arm/strlen.S | 17 | ||||
-rw-r--r-- | libc/string/arm/strncmp.S | 21 |
12 files changed, 103 insertions, 103 deletions
diff --git a/libc/string/arm/Makefile b/libc/string/arm/Makefile index ac0063770..0a95346fd 100644 --- a/libc/string/arm/Makefile +++ b/libc/string/arm/Makefile @@ -5,9 +5,9 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -top_srcdir=../../../ -top_builddir=../../../ +top_srcdir:=../../../ +top_builddir:=../../../ all: objs include $(top_builddir)Rules.mak -include Makefile.arch +include ../Makefile.in include $(top_srcdir)Makerules diff --git a/libc/string/arm/Makefile.arch b/libc/string/arm/Makefile.arch deleted file mode 100644 index 4b2550ee2..000000000 --- a/libc/string/arm/Makefile.arch +++ /dev/null @@ -1,27 +0,0 @@ -# Makefile for uClibc -# -# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> -# -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. -# - -SSRC:= _memcpy.S bcopy.S bzero.S memcmp.S memcpy.S memmove.S memset.S \ - strcmp.S strlen.S strncmp.S - -STRING_ARCH_DIR:=$(top_srcdir)libc/string/arm -STRING_ARCH_OUT:=$(top_builddir)libc/string/arm - -STRING_ARCH_SRC:=$(patsubst %.S,$(STRING_ARCH_DIR)/%.S,$(SSRC)) -STRING_ARCH_OBJ:=$(patsubst %.S,$(STRING_ARCH_OUT)/%.o,$(SSRC)) - -STRING_ARCH_OBJS:=$(STRING_ARCH_OBJ) - -libc-a-$(UCLIBC_HAS_STRING_ARCH_OPT)+=$(STRING_ARCH_OBJS) -libc-so-$(UCLIBC_HAS_STRING_ARCH_OPT)+=$(STRING_ARCH_OBJS:.o=.os) - -libc-nomulti-$(UCLIBC_HAS_STRING_ARCH_OPT)+=$(STRING_ARCH_OBJS) - -objclean-y+=string_arch_objclean - -string_arch_objclean: - $(RM) $(STRING_ARCH_OUT)/*.{o,os} diff --git a/libc/string/arm/_memcpy.S b/libc/string/arm/_memcpy.S index e8d78af23..3704f96b5 100644 --- a/libc/string/arm/_memcpy.S +++ b/libc/string/arm/_memcpy.S @@ -37,7 +37,7 @@ * by Erik Andersen <andersen@codepoet.org> */ - +#include <features.h> #include <endian.h> /* @@ -83,8 +83,11 @@ _memcpy: bcc .Lmemcpy_backwards moveq r0, #0 /* Quick abort for len=0 */ - moveq pc, lr - +#if defined(__USE_BX__) + bxeq lr +#else + moveq pc, lr +#endif stmdb sp!, {r0, lr} /* memcpy() returns dest addr */ subs r2, r2, #4 blt .Lmemcpy_fl4 /* less than 4 bytes */ @@ -389,8 +392,11 @@ _memcpy: .Lmemcpy_bl4: /* less than 4 bytes to go */ adds r2, r2, #4 +#if defined(__USE_BX__) + bxeq lr +#else moveq pc, lr /* done */ - +#endif /* copy the crud byte at a time */ cmp r2, #2 ldrb r3, [r1, #-1]! @@ -399,8 +405,11 @@ _memcpy: strgeb r3, [r0, #-1]! ldrgtb r3, [r1, #-1]! strgtb r3, [r0, #-1]! +#if defined(__USE_BX__) + bx lr +#else mov pc, lr - +#endif /* erg - unaligned destination */ .Lmemcpy_bdestul: cmp r12, #2 diff --git a/libc/string/arm/bcopy.S b/libc/string/arm/bcopy.S index 2914b8972..0e559225f 100644 --- a/libc/string/arm/bcopy.S +++ b/libc/string/arm/bcopy.S @@ -42,18 +42,15 @@ #include <features.h> .text -.global __bcopy -.hidden __bcopy -.type __bcopy,%function +.global bcopy +.type bcopy,%function .align 4 -__bcopy: +bcopy: /* switch the source and destination registers */ eor r0, r1, r0 eor r1, r0, r1 eor r0, r1, r0 - b _memcpy (PLT) + b _memcpy /* (PLT) */ -.size __bcopy,.-__bcopy - -strong_alias(__bcopy,bcopy) +.size bcopy,.-bcopy diff --git a/libc/string/arm/bzero.S b/libc/string/arm/bzero.S index 2cb67097e..c1eb93323 100644 --- a/libc/string/arm/bzero.S +++ b/libc/string/arm/bzero.S @@ -40,16 +40,13 @@ #include <features.h> .text -.global __bzero -.hidden __bzero -.type __bzero,%function +.global bzero +.type bzero,%function .align 4 -__bzero: +bzero: mov r2, r1 mov r1, #0 - b __memset + b HIDDEN_JUMPTARGET(memset) -.size __bzero,.-__bzero - -strong_alias(__bzero,bzero) +.size bzero,.-bzero diff --git a/libc/string/arm/memcmp.S b/libc/string/arm/memcmp.S index a97e02742..af1b876ed 100644 --- a/libc/string/arm/memcmp.S +++ b/libc/string/arm/memcmp.S @@ -32,17 +32,19 @@ #include <features.h> .text -.global __memcmp -.hidden __memcmp -.type __memcmp,%function +.global memcmp +.type memcmp,%function .align 4 -__memcmp: +memcmp: /* if ((len - 1) < 0) return 0 */ subs r2, r2, #1 movmi r0, #0 +#if defined(__USE_BX__) + bxmi lr +#else movmi pc, lr - +#endif /* ip == last src address to compare */ add ip, r0, r2 1: @@ -52,9 +54,13 @@ __memcmp: cmpcs r2, r3 beq 1b sub r0, r2, r3 - mov pc, lr +#if defined(__USE_BX__) + bx lr +#else + mov pc, lr +#endif -.size __memcmp,.-__memcmp +.size memcmp,.-memcmp -strong_alias(__memcmp,memcmp) -strong_alias(__memcmp,bcmp) +libc_hidden_def(memcmp) +strong_alias(memcmp,bcmp) diff --git a/libc/string/arm/memcpy.S b/libc/string/arm/memcpy.S index 8f81a15e5..7a5b6ab76 100644 --- a/libc/string/arm/memcpy.S +++ b/libc/string/arm/memcpy.S @@ -40,16 +40,15 @@ #include <features.h> .text -.global __memcpy -.hidden __memcpy -.type __memcpy,%function +.global memcpy +.type memcpy,%function .align 4 -__memcpy: +memcpy: stmfd sp!, {r0, lr} bl _memcpy ldmfd sp!, {r0, pc} -.size __memcpy,.-__memcpy +.size memcpy,.-memcpy -strong_alias(__memcpy,memcpy) +libc_hidden_def(memcpy) diff --git a/libc/string/arm/memmove.S b/libc/string/arm/memmove.S index a26cf731e..45cd9b4d4 100644 --- a/libc/string/arm/memmove.S +++ b/libc/string/arm/memmove.S @@ -40,16 +40,15 @@ #include <features.h> .text -.global __memmove -.hidden __memmove -.type __memmove,%function +.global memmove +.type memmove,%function .align 4 -__memmove: +memmove: stmfd sp!, {r0, lr} bl _memcpy ldmfd sp!, {r0, pc} -.size __memmove,.-__memmove +.size memmove,.-memmove -strong_alias(__memmove,memmove) +libc_hidden_def(memmove) diff --git a/libc/string/arm/memset.S b/libc/string/arm/memset.S index dea05a6b0..16bfe0dc5 100644 --- a/libc/string/arm/memset.S +++ b/libc/string/arm/memset.S @@ -21,12 +21,11 @@ #include <sys/syscall.h> .text -.global __memset -.hidden __memset -.type __memset,%function +.global memset +.type memset,%function .align 4 -__memset: +memset: mov a4, a1 cmp a3, $8 @ at least 8 bytes to do? blt 2f @@ -57,7 +56,11 @@ __memset: bge 1b 2: movs a3, a3 @ anything left? - moveq pc, lr @ nope +#if defined(__USE_BX__) + bxeq lr +#else + moveq pc, lr @ nope +#endif rsb a3, a3, $7 add pc, pc, a3, lsl $2 mov r0, r0 @@ -68,8 +71,12 @@ __memset: strb a2, [a4], $1 strb a2, [a4], $1 strb a2, [a4], $1 - mov pc, lr +#if defined(__USE_BX__) + bx lr +#else + mov pc, lr +#endif -.size __memset,.-__memset +.size memset,.-memset -strong_alias(__memset,memset) +libc_hidden_def(memset) diff --git a/libc/string/arm/strcmp.S b/libc/string/arm/strcmp.S index 3f462dec0..89aa38874 100644 --- a/libc/string/arm/strcmp.S +++ b/libc/string/arm/strcmp.S @@ -32,12 +32,11 @@ #include <features.h> .text -.global __strcmp -.hidden __strcmp -.type __strcmp,%function +.global strcmp +.type strcmp,%function .align 4 -__strcmp: +strcmp: 1: ldrb r2, [r0], #1 ldrb r3, [r1], #1 @@ -45,12 +44,16 @@ __strcmp: cmpcs r2, r3 beq 1b sub r0, r2, r3 - mov pc, lr +#if defined(__USE_BX__) + bx lr +#else + mov pc, lr +#endif -.size __strcmp,.-__strcmp +.size strcmp,.-strcmp -strong_alias(__strcmp,strcmp) +libc_hidden_def(strcmp) #ifndef __UCLIBC_HAS_LOCALE__ -hidden_strong_alias(__strcmp,__strcoll) -strong_alias(__strcmp,strcoll) +strong_alias(strcmp,strcoll) +libc_hidden_def(strcoll) #endif diff --git a/libc/string/arm/strlen.S b/libc/string/arm/strlen.S index f623cbe20..5b4b02e17 100644 --- a/libc/string/arm/strlen.S +++ b/libc/string/arm/strlen.S @@ -27,12 +27,11 @@ */ .text -.global __strlen -.hidden __strlen -.type __strlen,%function +.global strlen +.type strlen,%function .align 4 -__strlen: +strlen: bic r1, r0, $3 @ addr of word containing first byte ldr r2, [r1], $4 @ get the first word ands r3, r0, $3 @ how many bytes are duff? @@ -76,8 +75,12 @@ Llastword: @ drop through to here once we find a tstne r2, $0x00ff0000 @ (if first three all non-zero, 4th addne r0, r0, $1 @ must be zero) #endif - mov pc,lr +#if defined(__USE_BX__) + bx lr +#else + mov pc,lr +#endif -.size __strlen,.-__strlen +.size strlen,.-strlen -strong_alias(__strlen,strlen) +libc_hidden_def(strlen) diff --git a/libc/string/arm/strncmp.S b/libc/string/arm/strncmp.S index a3278727e..d6b36312a 100644 --- a/libc/string/arm/strncmp.S +++ b/libc/string/arm/strncmp.S @@ -32,16 +32,19 @@ #include <features.h> .text -.global __strncmp -.hidden __strncmp -.type __strncmp,%function +.global strncmp +.type strncmp,%function .align 4 -__strncmp: +strncmp: /* if (len == 0) return 0 */ cmp r2, #0 moveq r0, #0 +#if defined(__USE_BX__) + bxeq lr +#else moveq pc, lr +#endif subs r2, r2, #1 /* ip == last src address to compare */ @@ -54,8 +57,12 @@ __strncmp: cmpcs r2, r3 beq 1b sub r0, r2, r3 - mov pc, lr +#if defined(__USE_BX__) + bx lr +#else + mov pc, lr +#endif -.size __strncmp,.-__strncmp +.size strncmp,.-strncmp -strong_alias(__strncmp,strncmp) +libc_hidden_def(strncmp) |