patch-2.1.44 linux/arch/mips/lib/strlen_user.S

Next file: linux/arch/mips/lib/strncpy_user.S
Previous file: linux/arch/mips/lib/pmaxio.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.43/linux/arch/mips/lib/strlen_user.S linux/arch/mips/lib/strlen_user.S
@@ -0,0 +1,33 @@
+/*
+ * arch/mips/lib/strlen_user.S
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (c) 1996 by Ralf Baechle
+ */
+#include <asm/asm.h>
+#include <asm/regdef.h>
+#include <asm/sgidefs.h>
+
+/*
+ * Return the size of a string (including the ending 0)
+ *
+ * Return 0 for error
+ */
+LEAF(__strlen_user)
+		move		v0,zero
+1:		lb		t0,(a0)
+		LONG_ADDIU	v0,1
+		LONG_ADDIU	a0,1
+		bnez		t0,1b
+		jr		ra
+		END(__strlen_user)
+
+		.section	__ex_table,"a"
+		PTR		1b,fault
+		.previous
+
+fault:		move		v0,zero
+		jr		ra

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov