diff options
author | Greg Ungerer <gerg@uclinux.org> | 2011-03-28 02:48:00 -0400 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2011-05-23 20:03:49 -0400 |
commit | d10ed2f5383cc6e6b7649f03540b8cb1838d5f67 (patch) | |
tree | b2ee2537f23e452df1d98a88877ae28f7e3264fa /arch/m68k/lib/string.c | |
parent | 80160de89d0a7c9a93dfe91eef2b448cbc380cd0 (diff) |
m68k: remove duplicate memset() implementation
Merging the mmu and non-mmu directories we ended up with duplicate
implementations of memset(). One is a little more optimized for the
>= 68020 case, but that can easily be inserted into a single
implementation of memset(). 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 | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/arch/m68k/lib/string.c b/arch/m68k/lib/string.c index 711fa743e6be..6d2461237a16 100644 --- a/arch/m68k/lib/string.c +++ b/arch/m68k/lib/string.c | |||
@@ -21,67 +21,6 @@ char *strcat(char *dest, const char *src) | |||
21 | } | 21 | } |
22 | EXPORT_SYMBOL(strcat); | 22 | EXPORT_SYMBOL(strcat); |
23 | 23 | ||
24 | void *memset(void *s, int c, size_t count) | ||
25 | { | ||
26 | void *xs = s; | ||
27 | size_t temp, temp1; | ||
28 | |||
29 | if (!count) | ||
30 | return xs; | ||
31 | c &= 0xff; | ||
32 | c |= c << 8; | ||
33 | c |= c << 16; | ||
34 | if ((long)s & 1) { | ||
35 | char *cs = s; | ||
36 | *cs++ = c; | ||
37 | s = cs; | ||
38 | count--; | ||
39 | } | ||
40 | if (count > 2 && (long)s & 2) { | ||
41 | short *ss = s; | ||
42 | *ss++ = c; | ||
43 | s = ss; | ||
44 | count -= 2; | ||
45 | } | ||
46 | temp = count >> 2; | ||
47 | if (temp) { | ||
48 | long *ls = s; | ||
49 | |||
50 | asm volatile ( | ||
51 | " movel %1,%2\n" | ||
52 | " andw #7,%2\n" | ||
53 | " lsrl #3,%1\n" | ||
54 | " negw %2\n" | ||
55 | " jmp %%pc@(2f,%2:w:2)\n" | ||
56 | "1: movel %3,%0@+\n" | ||
57 | " movel %3,%0@+\n" | ||
58 | " movel %3,%0@+\n" | ||
59 | " movel %3,%0@+\n" | ||
60 | " movel %3,%0@+\n" | ||
61 | " movel %3,%0@+\n" | ||
62 | " movel %3,%0@+\n" | ||
63 | " movel %3,%0@+\n" | ||
64 | "2: dbra %1,1b\n" | ||
65 | " clrw %1\n" | ||
66 | " subql #1,%1\n" | ||
67 | " jpl 1b" | ||
68 | : "=a" (ls), "=d" (temp), "=&d" (temp1) | ||
69 | : "d" (c), "0" (ls), "1" (temp)); | ||
70 | s = ls; | ||
71 | } | ||
72 | if (count & 2) { | ||
73 | short *ss = s; | ||
74 | *ss++ = c; | ||
75 | s = ss; | ||
76 | } | ||
77 | if (count & 1) { | ||
78 | char *cs = s; | ||
79 | *cs = c; | ||
80 | } | ||
81 | return xs; | ||
82 | } | ||
83 | EXPORT_SYMBOL(memset); | ||
84 | |||
85 | void *memcpy(void *to, const void *from, size_t n) | 24 | void *memcpy(void *to, const void *from, size_t n) |
86 | { | 25 | { |
87 | void *xto = to; | 26 | void *xto = to; |