Index: arch/mips/lib/memcpy.S =================================================================== RCS file: /cvs/linux/arch/mips/lib/memcpy.S,v retrieving revision 1.6.2.3 diff -u -r1.6.2.3 memcpy.S --- arch/mips/lib/memcpy.S 2002/06/30 23:10:57 1.6.2.3 +++ arch/mips/lib/memcpy.S 2002/09/12 08:12:21 @@ -99,6 +99,24 @@ #define NBYTES 8 #define LOG_NBYTES 3 +/* + * As we are sharing code base with the mips32 tree (which use the o32 ABI + * register definitions). We need to redefine the register definitions from + * the n64 ABI register naming to the o32 ABI register naming. + */ +#undef t0 +#undef t1 +#undef t2 +#undef t3 +#define t0 $8 +#define t1 $9 +#define t2 $10 +#define t3 $11 +#define t4 $12 +#define t5 $13 +#define t6 $14 +#define t7 $15 + #else #define LOAD lw @@ -385,7 +403,7 @@ * * Assumes src < THREAD_BUADDR($28) */ - lw t0, THREAD_BUADDR($28) + LOAD t0, THREAD_BUADDR($28) 1: EXC( lb t1, 0(src), l_exc) ADD src, src, 1 @@ -393,16 +411,16 @@ bne src, t0, 1b ADD dst, dst, 1 l_exc: - lw t0, THREAD_BUADDR($28) # t0 is just past last good address + LOAD t0, THREAD_BUADDR($28) # t0 is just past last good address nop - subu len, AT, t0 # len number of uncopied bytes + SUB len, AT, t0 # len number of uncopied bytes /* * Here's where we rely on src and dst being incremented in tandem, * See (3) above. * dst += (fault addr - src) to put dst at first byte to clear */ - addu dst, t0 # compute start address in a1 - subu dst, src + ADD dst, t0 # compute start address in a1 + SUB dst, src /* * Clear len bytes starting at dst. Can't call __bzero because it * might modify len. An inefficient loop for these rare times... @@ -440,8 +458,8 @@ .align 5 LEAF(memmove) - addu t0, a0, a2 - addu t1, a1, a2 + ADD t0, a0, a2 + ADD t1, a1, a2 sltu t0, a1, t0 # dst + len <= src -> memcpy sltu t1, a0, t1 # dst >= src + len -> memcpy and t0, t1 @@ -455,16 +473,16 @@ sltu t0, a1, a0 beqz t0, r_end_bytes_up # src >= dst nop - addu a0, a2 # dst = dst + len - addu a1, a2 # src = src + len + ADD a0, a2 # dst = dst + len + ADD a1, a2 # src = src + len r_end_bytes: lb t0, -1(a1) - subu a2, a2, 0x1 + SUB a2, a2, 0x1 sb t0, -1(a0) - subu a1, a1, 0x1 + SUB a1, a1, 0x1 bnez a2, r_end_bytes - subu a0, a0, 0x1 + SUB a0, a0, 0x1 r_out: jr ra @@ -472,11 +490,11 @@ r_end_bytes_up: lb t0, (a1) - subu a2, a2, 0x1 + SUB a2, a2, 0x1 sb t0, (a0) - addu a1, a1, 0x1 + ADD a1, a1, 0x1 bnez a2, r_end_bytes_up - addu a0, a0, 0x1 + ADD a0, a0, 0x1 jr ra move a2, zero