PERFORCE change 105362 for review

Oleksandr Tymoshenko gonzo at FreeBSD.org
Wed Aug 30 21:14:55 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=105362

Change 105362 by gonzo at gonzo_hq on 2006/08/30 21:14:31

	o Import string functions from NetBSD.

Affected files ...

.. //depot/projects/mips2/src/lib/libc/mips/string/bcmp.S#2 edit
.. //depot/projects/mips2/src/lib/libc/mips/string/bcopy.S#1 add
.. //depot/projects/mips2/src/lib/libc/mips/string/bzero.S#2 edit
.. //depot/projects/mips2/src/lib/libc/mips/string/ffs.S#1 add
.. //depot/projects/mips2/src/lib/libc/mips/string/index.S#2 edit
.. //depot/projects/mips2/src/lib/libc/mips/string/memcpy.S#1 add
.. //depot/projects/mips2/src/lib/libc/mips/string/memmove.S#1 add
.. //depot/projects/mips2/src/lib/libc/mips/string/rindex.S#2 edit
.. //depot/projects/mips2/src/lib/libc/mips/string/strcmp.S#1 add
.. //depot/projects/mips2/src/lib/libc/mips/string/strlen.S#1 add

Differences ...

==== //depot/projects/mips2/src/lib/libc/mips/string/bcmp.S#2 (text+ko) ====

@@ -32,9 +32,7 @@
  * SUCH DAMAGE.
  */
 
-#include <mips/asm.h>
-#define _LOCORE		/* XXX not really, just assembly-code source */
-#include <machine/endian.h>	/* LWLO/LWHI, SWLO/SWHI */
+#include <machine/asm.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
 	ASMSTR("from: @(#)bcmp.s	8.1 (Berkeley) 6/4/93")
@@ -60,8 +58,13 @@
 	beq	a3, zero, 1f
 	subu	a2, a2, a3		# subtract from remaining count
 	move	v0, v1			# init v0,v1 so unmodified bytes match
-	LWHI	v0, 0(a0)		# read 1, 2, or 3 bytes
-	LWHI	v1, 0(a1)
+#ifdef __MIPSEB__
+	lwl	v0, 0(a0)		# read 1, 2, or 3 bytes
+	lwl	v1, 0(a1)
+#else
+	lwr	v0, 0(a0)		# read 1, 2, or 3 bytes
+	lwr	v1, 0(a1)
+#endif
 	addu	a1, a1, a3
 	bne	v0, v1, nomatch
 	addu	a0, a0, a3
@@ -96,8 +99,13 @@
 	subu	a2, a2, a3		#   which has to be >= (16-3) & ~3
 	addu	a3, a3, a0		# compute ending address
 3:
-	LWHI	v0, 0(a0)		# compare words a0 unaligned, a1 aligned
-	LWLO	v0, 3(a0)
+#ifdef __MIPSEB__
+	lwl	v0, 0(a0)		# compare words a0 unaligned, a1 aligned
+	lwr	v0, 3(a0)
+#else
+	lwr	v0, 0(a0)		# compare words a0 unaligned, a1 aligned
+	lwl	v0, 3(a0)
+#endif
 	lw	v1, 0(a1)
 	addu	a0, a0, 4
 	bne	v0, v1, nomatch

==== //depot/projects/mips2/src/lib/libc/mips/string/bzero.S#2 (text+ko) ====

@@ -32,7 +32,7 @@
  * SUCH DAMAGE.
  */
 
-#include <mips/asm.h>
+#include <machine/asm.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
 	ASMSTR("from: @(#)bzero.s	8.1 (Berkeley) 6/4/93")
@@ -40,9 +40,6 @@
 #endif /* LIBC_SCCS and not lint */
 
 
-#define _LOCORE		/* XXX not really, just assembly-code source */
-#include <machine/endian.h>
-
 #ifdef __ABICALLS__
 	.abicalls
 #endif
@@ -56,7 +53,11 @@
 	and	a3, a3, 3
 	beq	a3, zero, 1f		# skip if word aligned
 	subu	a1, a1, a3		# subtract from remaining count
-	SWHI	zero, 0(a0)		# clear 1, 2, or 3 bytes to align
+#ifdef __MIPSEB__
+	swl	zero, 0(a0)		# clear 1, 2, or 3 bytes to align
+#else
+	swr	zero, 0(a0)		# clear 1, 2, or 3 bytes to align
+#endif
 	addu	a0, a0, a3
 1:
 	and	v0, a1, 3		# compute number of words left

==== //depot/projects/mips2/src/lib/libc/mips/string/index.S#2 (text+ko) ====

@@ -32,7 +32,7 @@
  * SUCH DAMAGE.
  */
 
-#include <mips/asm.h>
+#include <machine/asm.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
 	ASMSTR("from: @(#)index.s	8.1 (Berkeley) 6/4/93")

==== //depot/projects/mips2/src/lib/libc/mips/string/rindex.S#2 (text+ko) ====

@@ -32,7 +32,7 @@
  * SUCH DAMAGE.
  */
 
-#include <mips/asm.h>
+#include <machine/asm.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
 	ASMSTR("from: @(#)rindex.s	8.1 (Berkeley) 6/4/93")


More information about the p4-projects mailing list