Commit c50e19f49830fb651b4b702ad2c3abcdf110b576
Committed by
Bryan Wu
1 parent
a5bb85dfff
Exists in
master
and in
7 other branches
[Blackfin] arch: fix bug - make memcpy return the dest addr.
The memcpy() function returns the src pointer instead of the dst pointer. This patch fix this bug. Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Showing 1 changed file with 2 additions and 6 deletions Side-by-side Diff
arch/blackfin/lib/memcpy.S
... | ... | @@ -70,8 +70,8 @@ |
70 | 70 | /* Check for aligned data.*/ |
71 | 71 | |
72 | 72 | R3 = R1 | R0; |
73 | - R0 = 0x3; | |
74 | - R3 = R3 & R0; | |
73 | + R1 = 0x3; | |
74 | + R3 = R3 & R1; | |
75 | 75 | CC = R3; /* low bits set on either address? */ |
76 | 76 | IF CC JUMP .Lnot_aligned; |
77 | 77 | |
... | ... | @@ -83,7 +83,6 @@ |
83 | 83 | /* less than eight bytes... */ |
84 | 84 | P2 = R2; |
85 | 85 | LSETUP(.Lthree_start, .Lthree_end) LC0=P2; |
86 | - R0 = R1; /* setup src address for return */ | |
87 | 86 | .Lthree_start: |
88 | 87 | R3 = B[P1++] (X); |
89 | 88 | .Lthree_end: |
... | ... | @@ -95,7 +94,6 @@ |
95 | 94 | /* There's at least eight bytes to copy. */ |
96 | 95 | P2 += -1; /* because we unroll one iteration */ |
97 | 96 | LSETUP(.Lword_loops, .Lword_loope) LC0=P2; |
98 | - R0 = R1; | |
99 | 97 | I1 = P1; |
100 | 98 | R3 = [I1++]; |
101 | 99 | #if ANOMALY_05000202 |
... | ... | @@ -120,7 +118,6 @@ |
120 | 118 | .Lnot_aligned: |
121 | 119 | /* From here, we're copying byte-by-byte. */ |
122 | 120 | LSETUP (.Lbyte_start, .Lbyte_end) LC0=P2; |
123 | - R0 = R1; /* Save src address for return */ | |
124 | 121 | .Lbyte_start: |
125 | 122 | R1 = B[P1++] (X); |
126 | 123 | .Lbyte_end: |
... | ... | @@ -135,7 +132,6 @@ |
135 | 132 | * Don't bother to work out alignment for |
136 | 133 | * the reverse case. |
137 | 134 | */ |
138 | - R0 = R1; /* save src for later. */ | |
139 | 135 | P0 = P0 + P2; |
140 | 136 | P0 += -1; |
141 | 137 | P1 = P1 + P2; |