diff options
author | Paul Mackerras <paulus@samba.org> | 2006-08-30 23:22:58 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-08-30 23:22:58 -0400 |
commit | d0027bf09f09d95a23b8f476ba8cea28f2576781 (patch) | |
tree | 8dc94937525548c34c73c648fdeb2d9d0dc895fb /arch/powerpc/lib | |
parent | e7498656b5e2e9e3806d263fecc90b2707d02093 (diff) |
[POWERPC] Fix return value from memcpy
As pointed out by Herbert Xu <herbert@gondor.apana.org.au>, our
memcpy implementation didn't return the destination pointer as its
return value, and there is code in the kernel that expects that.
This fixes it.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r-- | arch/powerpc/lib/memcpy_64.S | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/powerpc/lib/memcpy_64.S b/arch/powerpc/lib/memcpy_64.S index fd66acfd3e3e..7173ba98f427 100644 --- a/arch/powerpc/lib/memcpy_64.S +++ b/arch/powerpc/lib/memcpy_64.S | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | .align 7 | 12 | .align 7 |
13 | _GLOBAL(memcpy) | 13 | _GLOBAL(memcpy) |
14 | std r3,48(r1) /* save destination pointer for return value */ | ||
14 | mtcrf 0x01,r5 | 15 | mtcrf 0x01,r5 |
15 | cmpldi cr1,r5,16 | 16 | cmpldi cr1,r5,16 |
16 | neg r6,r3 # LS 3 bits = # bytes to 8-byte dest bdry | 17 | neg r6,r3 # LS 3 bits = # bytes to 8-byte dest bdry |
@@ -38,7 +39,7 @@ _GLOBAL(memcpy) | |||
38 | stdu r9,16(r3) | 39 | stdu r9,16(r3) |
39 | bdnz 1b | 40 | bdnz 1b |
40 | 3: std r8,8(r3) | 41 | 3: std r8,8(r3) |
41 | beqlr | 42 | beq 3f |
42 | addi r3,r3,16 | 43 | addi r3,r3,16 |
43 | ld r9,8(r4) | 44 | ld r9,8(r4) |
44 | .Ldo_tail: | 45 | .Ldo_tail: |
@@ -53,7 +54,8 @@ _GLOBAL(memcpy) | |||
53 | 2: bf cr7*4+3,3f | 54 | 2: bf cr7*4+3,3f |
54 | rotldi r9,r9,8 | 55 | rotldi r9,r9,8 |
55 | stb r9,0(r3) | 56 | stb r9,0(r3) |
56 | 3: blr | 57 | 3: ld r3,48(r1) /* return dest pointer */ |
58 | blr | ||
57 | 59 | ||
58 | .Lsrc_unaligned: | 60 | .Lsrc_unaligned: |
59 | srdi r6,r5,3 | 61 | srdi r6,r5,3 |
@@ -115,7 +117,7 @@ _GLOBAL(memcpy) | |||
115 | 5: srd r12,r9,r11 | 117 | 5: srd r12,r9,r11 |
116 | or r12,r8,r12 | 118 | or r12,r8,r12 |
117 | std r12,24(r3) | 119 | std r12,24(r3) |
118 | beqlr | 120 | beq 4f |
119 | cmpwi cr1,r5,8 | 121 | cmpwi cr1,r5,8 |
120 | addi r3,r3,32 | 122 | addi r3,r3,32 |
121 | sld r9,r9,r10 | 123 | sld r9,r9,r10 |
@@ -167,4 +169,5 @@ _GLOBAL(memcpy) | |||
167 | 3: bf cr7*4+3,4f | 169 | 3: bf cr7*4+3,4f |
168 | lbz r0,0(r4) | 170 | lbz r0,0(r4) |
169 | stb r0,0(r3) | 171 | stb r0,0(r3) |
170 | 4: blr | 172 | 4: ld r3,48(r1) /* return dest pointer */ |
173 | blr | ||