mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 23:52:40 +00:00
sparc32: Correct the return value of memcpy.
Properly return the original destination buffer pointer. Signed-off-by: David S. Miller <davem@davemloft.net> Tested-by: Kjetil Oftedal <oftedal@gmail.com>
This commit is contained in:
parent
21f74d361d
commit
a52312b88c
1 changed files with 7 additions and 15 deletions
|
@ -13,14 +13,6 @@
|
||||||
.align 4; \
|
.align 4; \
|
||||||
x:
|
x:
|
||||||
|
|
||||||
|
|
||||||
/* In kernel these functions don't return a value.
|
|
||||||
* One should use macros in asm/string.h for that purpose.
|
|
||||||
* We return 0, so that bugs are more apparent.
|
|
||||||
*/
|
|
||||||
#define SETUP_RETL
|
|
||||||
#define RETL_INSN clr %o0
|
|
||||||
|
|
||||||
/* Both these macros have to start with exactly the same insn */
|
/* Both these macros have to start with exactly the same insn */
|
||||||
#define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
|
#define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
|
||||||
ldd [%src + (offset) + 0x00], %t0; \
|
ldd [%src + (offset) + 0x00], %t0; \
|
||||||
|
@ -154,7 +146,7 @@ FUNC(__memmove)
|
||||||
#endif
|
#endif
|
||||||
FUNC(memmove)
|
FUNC(memmove)
|
||||||
cmp %o0, %o1
|
cmp %o0, %o1
|
||||||
SETUP_RETL
|
mov %o0, %g7
|
||||||
bleu 9f
|
bleu 9f
|
||||||
sub %o0, %o1, %o4
|
sub %o0, %o1, %o4
|
||||||
|
|
||||||
|
@ -178,7 +170,7 @@ FUNC(memmove)
|
||||||
sub %o0, 1, %o0
|
sub %o0, 1, %o0
|
||||||
|
|
||||||
retl
|
retl
|
||||||
RETL_INSN
|
mov %g7, %o0
|
||||||
|
|
||||||
/* NOTE: This code is executed just for the cases,
|
/* NOTE: This code is executed just for the cases,
|
||||||
where %src (=%o1) & 3 is != 0.
|
where %src (=%o1) & 3 is != 0.
|
||||||
|
@ -212,7 +204,7 @@ FUNC(memmove)
|
||||||
FUNC(memcpy) /* %o0=dst %o1=src %o2=len */
|
FUNC(memcpy) /* %o0=dst %o1=src %o2=len */
|
||||||
|
|
||||||
sub %o0, %o1, %o4
|
sub %o0, %o1, %o4
|
||||||
SETUP_RETL
|
mov %o0, %g7
|
||||||
9:
|
9:
|
||||||
andcc %o4, 3, %o5
|
andcc %o4, 3, %o5
|
||||||
0:
|
0:
|
||||||
|
@ -308,7 +300,7 @@ FUNC(memcpy) /* %o0=dst %o1=src %o2=len */
|
||||||
stb %g2, [%o0]
|
stb %g2, [%o0]
|
||||||
1:
|
1:
|
||||||
retl
|
retl
|
||||||
RETL_INSN
|
mov %g7, %o0
|
||||||
|
|
||||||
82: /* ldd_std */
|
82: /* ldd_std */
|
||||||
MOVE_BIGALIGNCHUNK(o1, o0, 0x00, o2, o3, o4, o5, g2, g3, g4, g5)
|
MOVE_BIGALIGNCHUNK(o1, o0, 0x00, o2, o3, o4, o5, g2, g3, g4, g5)
|
||||||
|
@ -373,7 +365,7 @@ FUNC(memcpy) /* %o0=dst %o1=src %o2=len */
|
||||||
stb %g2, [%o0]
|
stb %g2, [%o0]
|
||||||
1:
|
1:
|
||||||
retl
|
retl
|
||||||
RETL_INSN
|
mov %g7, %o0
|
||||||
|
|
||||||
86: /* non_aligned */
|
86: /* non_aligned */
|
||||||
cmp %o2, 6
|
cmp %o2, 6
|
||||||
|
@ -498,7 +490,7 @@ FUNC(memcpy) /* %o0=dst %o1=src %o2=len */
|
||||||
stb %g2, [%i0 + 4]
|
stb %g2, [%i0 + 4]
|
||||||
1:
|
1:
|
||||||
ret
|
ret
|
||||||
restore %g0, %g0, %o0
|
restore %g7, %g0, %o0
|
||||||
|
|
||||||
88: /* short_end */
|
88: /* short_end */
|
||||||
|
|
||||||
|
@ -529,7 +521,7 @@ FUNC(memcpy) /* %o0=dst %o1=src %o2=len */
|
||||||
stb %g2, [%o0]
|
stb %g2, [%o0]
|
||||||
1:
|
1:
|
||||||
retl
|
retl
|
||||||
RETL_INSN
|
mov %g7, %o0
|
||||||
|
|
||||||
90: /* short_aligned_end */
|
90: /* short_aligned_end */
|
||||||
bne 88b
|
bne 88b
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue