diff options
author | Greg Ungerer <gerg@uclinux.org> | 2011-03-28 02:53:37 -0400 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2011-05-23 20:03:49 -0400 |
commit | 66d83ab32aec5d84d707d4d72717b9468ec33a96 (patch) | |
tree | 09a7748e0980fd99b6925a92ad5af53c87638a53 /arch/m68k/lib/string.c | |
parent | d10ed2f5383cc6e6b7649f03540b8cb1838d5f67 (diff) |
m68k: remove duplicate memcpy() implementation
Merging the mmu and non-mmu directories we ended up with duplicate
implementations of memcpy(). One is a little more optimized for the
>= 68020 case, but that can easily be inserted into a single
implementation of memcpy(). Clean up the exporting of this symbol
too, otherwise we end up exporting it twice on a no-mmu build.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/lib/string.c')
-rw-r--r-- | arch/m68k/lib/string.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/arch/m68k/lib/string.c b/arch/m68k/lib/string.c index 6d2461237a16..b9a57abfad08 100644 --- a/arch/m68k/lib/string.c +++ b/arch/m68k/lib/string.c | |||
@@ -20,70 +20,3 @@ char *strcat(char *dest, const char *src) | |||
20 | return __kernel_strcpy(dest + __kernel_strlen(dest), src); | 20 | return __kernel_strcpy(dest + __kernel_strlen(dest), src); |
21 | } | 21 | } |
22 | EXPORT_SYMBOL(strcat); | 22 | EXPORT_SYMBOL(strcat); |
23 | |||
24 | void *memcpy(void *to, const void *from, size_t n) | ||
25 | { | ||
26 | void *xto = to; | ||
27 | size_t temp, temp1; | ||
28 | |||
29 | if (!n) | ||
30 | return xto; | ||
31 | if ((long)to & 1) { | ||
32 | char *cto = to; | ||
33 | const char *cfrom = from; | ||
34 | *cto++ = *cfrom++; | ||
35 | to = cto; | ||
36 | from = cfrom; | ||
37 | n--; | ||
38 | } | ||
39 | if (n > 2 && (long)to & 2) { | ||
40 | short *sto = to; | ||
41 | const short *sfrom = from; | ||
42 | *sto++ = *sfrom++; | ||
43 | to = sto; | ||
44 | from = sfrom; | ||
45 | n -= 2; | ||
46 | } | ||
47 | temp = n >> 2; | ||
48 | if (temp) { | ||
49 | long *lto = to; | ||
50 | const long *lfrom = from; | ||
51 | |||
52 | asm volatile ( | ||
53 | " movel %2,%3\n" | ||
54 | " andw #7,%3\n" | ||
55 | " lsrl #3,%2\n" | ||
56 | " negw %3\n" | ||
57 | " jmp %%pc@(1f,%3:w:2)\n" | ||
58 | "4: movel %0@+,%1@+\n" | ||
59 | " movel %0@+,%1@+\n" | ||
60 | " movel %0@+,%1@+\n" | ||
61 | " movel %0@+,%1@+\n" | ||
62 | " movel %0@+,%1@+\n" | ||
63 | " movel %0@+,%1@+\n" | ||
64 | " movel %0@+,%1@+\n" | ||
65 | " movel %0@+,%1@+\n" | ||
66 | "1: dbra %2,4b\n" | ||
67 | " clrw %2\n" | ||
68 | " subql #1,%2\n" | ||
69 | " jpl 4b" | ||
70 | : "=a" (lfrom), "=a" (lto), "=d" (temp), "=&d" (temp1) | ||
71 | : "0" (lfrom), "1" (lto), "2" (temp)); | ||
72 | to = lto; | ||
73 | from = lfrom; | ||
74 | } | ||
75 | if (n & 2) { | ||
76 | short *sto = to; | ||
77 | const short *sfrom = from; | ||
78 | *sto++ = *sfrom++; | ||
79 | to = sto; | ||
80 | from = sfrom; | ||
81 | } | ||
82 | if (n & 1) { | ||
83 | char *cto = to; | ||
84 | const char *cfrom = from; | ||
85 | *cto = *cfrom; | ||
86 | } | ||
87 | return xto; | ||
88 | } | ||
89 | EXPORT_SYMBOL(memcpy); | ||