Root/
1 | |
2 | #include <linux/types.h> |
3 | |
4 | void * memcpy(void * to, const void * from, size_t n) |
5 | { |
6 | #ifdef CONFIG_COLDFIRE |
7 | void *xto = to; |
8 | size_t temp; |
9 | |
10 | if (!n) |
11 | return xto; |
12 | if ((long) to & 1) |
13 | { |
14 | char *cto = to; |
15 | const char *cfrom = from; |
16 | *cto++ = *cfrom++; |
17 | to = cto; |
18 | from = cfrom; |
19 | n--; |
20 | } |
21 | if (n > 2 && (long) to & 2) |
22 | { |
23 | short *sto = to; |
24 | const short *sfrom = from; |
25 | *sto++ = *sfrom++; |
26 | to = sto; |
27 | from = sfrom; |
28 | n -= 2; |
29 | } |
30 | temp = n >> 2; |
31 | if (temp) |
32 | { |
33 | long *lto = to; |
34 | const long *lfrom = from; |
35 | for (; temp; temp--) |
36 | *lto++ = *lfrom++; |
37 | to = lto; |
38 | from = lfrom; |
39 | } |
40 | if (n & 2) |
41 | { |
42 | short *sto = to; |
43 | const short *sfrom = from; |
44 | *sto++ = *sfrom++; |
45 | to = sto; |
46 | from = sfrom; |
47 | } |
48 | if (n & 1) |
49 | { |
50 | char *cto = to; |
51 | const char *cfrom = from; |
52 | *cto = *cfrom; |
53 | } |
54 | return xto; |
55 | #else |
56 | const char *c_from = from; |
57 | char *c_to = to; |
58 | while (n-- > 0) |
59 | *c_to++ = *c_from++; |
60 | return((void *) to); |
61 | #endif |
62 | } |
63 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9