aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/m68k/include/asm/string.h32
-rw-r--r--arch/m68k/lib/Makefile2
-rw-r--r--arch/m68k/lib/string.c22
3 files changed, 1 insertions, 55 deletions
diff --git a/arch/m68k/include/asm/string.h b/arch/m68k/include/asm/string.h
index 9aea9f11fa25..c30c03d98581 100644
--- a/arch/m68k/include/asm/string.h
+++ b/arch/m68k/include/asm/string.h
@@ -4,20 +4,6 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/compiler.h> 5#include <linux/compiler.h>
6 6
7static inline char *__kernel_strcpy(char *dest, const char *src)
8{
9 char *xdest = dest;
10
11 asm volatile ("\n"
12 "1: move.b (%1)+,(%0)+\n"
13 " jne 1b"
14 : "+a" (dest), "+a" (src)
15 : : "memory");
16 return xdest;
17}
18
19#ifndef __IN_STRING_C
20
21#define __HAVE_ARCH_STRNLEN 7#define __HAVE_ARCH_STRNLEN
22static inline size_t strnlen(const char *s, size_t count) 8static inline size_t strnlen(const char *s, size_t count)
23{ 9{
@@ -34,16 +20,6 @@ static inline size_t strnlen(const char *s, size_t count)
34 return sc - s; 20 return sc - s;
35} 21}
36 22
37#define __HAVE_ARCH_STRCPY
38#if __GNUC__ >= 4
39#define strcpy(d, s) (__builtin_constant_p(s) && \
40 __builtin_strlen(s) <= 32 ? \
41 __builtin_strcpy(d, s) : \
42 __kernel_strcpy(d, s))
43#else
44#define strcpy(d, s) __kernel_strcpy(d, s)
45#endif
46
47#define __HAVE_ARCH_STRNCPY 23#define __HAVE_ARCH_STRNCPY
48static inline char *strncpy(char *dest, const char *src, size_t n) 24static inline char *strncpy(char *dest, const char *src, size_t n)
49{ 25{
@@ -61,12 +37,6 @@ static inline char *strncpy(char *dest, const char *src, size_t n)
61 return xdest; 37 return xdest;
62} 38}
63 39
64#define __HAVE_ARCH_STRCAT
65#define strcat(d, s) ({ \
66 char *__d = (d); \
67 strcpy(__d + strlen(__d), (s)); \
68})
69
70#ifndef CONFIG_COLDFIRE 40#ifndef CONFIG_COLDFIRE
71#define __HAVE_ARCH_STRCMP 41#define __HAVE_ARCH_STRCMP
72static inline int strcmp(const char *cs, const char *ct) 42static inline int strcmp(const char *cs, const char *ct)
@@ -100,6 +70,4 @@ extern void *memset(void *, int, __kernel_size_t);
100extern void *memcpy(void *, const void *, __kernel_size_t); 70extern void *memcpy(void *, const void *, __kernel_size_t);
101#define memcpy(d, s, n) __builtin_memcpy(d, s, n) 71#define memcpy(d, s, n) __builtin_memcpy(d, s, n)
102 72
103#endif
104
105#endif /* _M68K_STRING_H_ */ 73#endif /* _M68K_STRING_H_ */
diff --git a/arch/m68k/lib/Makefile b/arch/m68k/lib/Makefile
index a9d782d34276..fcd8eb1d7c7d 100644
--- a/arch/m68k/lib/Makefile
+++ b/arch/m68k/lib/Makefile
@@ -6,7 +6,7 @@
6lib-y := ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ 6lib-y := ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
7 memcpy.o memset.o memmove.o 7 memcpy.o memset.o memmove.o
8 8
9lib-$(CONFIG_MMU) += string.o uaccess.o 9lib-$(CONFIG_MMU) += uaccess.o
10lib-$(CONFIG_CPU_HAS_NO_MULDIV64) += mulsi3.o divsi3.o udivsi3.o 10lib-$(CONFIG_CPU_HAS_NO_MULDIV64) += mulsi3.o divsi3.o udivsi3.o
11lib-$(CONFIG_CPU_HAS_NO_MULDIV64) += modsi3.o umodsi3.o 11lib-$(CONFIG_CPU_HAS_NO_MULDIV64) += modsi3.o umodsi3.o
12 12
diff --git a/arch/m68k/lib/string.c b/arch/m68k/lib/string.c
deleted file mode 100644
index 4d61fa8a112c..000000000000
--- a/arch/m68k/lib/string.c
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file COPYING in the main directory of this archive
4 * for more details.
5 */
6
7#define __IN_STRING_C
8
9#include <linux/module.h>
10#include <linux/string.h>
11
12char *strcpy(char *dest, const char *src)
13{
14 return __kernel_strcpy(dest, src);
15}
16EXPORT_SYMBOL(strcpy);
17
18char *strcat(char *dest, const char *src)
19{
20 return __kernel_strcpy(dest + strlen(dest), src);
21}
22EXPORT_SYMBOL(strcat);