patch-2.1.10 linux/arch/alpha/lib/strlen_user.S

Next file: linux/arch/i386/boot/Makefile
Previous file: linux/arch/alpha/defconfig
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.9/linux/arch/alpha/lib/strlen_user.S linux/arch/alpha/lib/strlen_user.S
@@ -1,5 +1,5 @@
 /*
- * arch/alpha/lib/strlen_user.S
+ * arch/alpha/lib/__strlen_user.S
  *
  * Just like strlen except returns -EFAULT if an exception occurs
  * before the terminator is found.
@@ -13,7 +13,7 @@
 	99: x,##y;			\
 	.section __ex_table,"a";	\
 	.gprel32 99b;			\
-	lda zero, $exception-99b(v0); 	\
+	lda zero, $exception-99b(zero);	\
 	.text
 
 
@@ -21,12 +21,12 @@
 	.set noat
 	.text
 
-	.globl strlen_user
-	.ent strlen_user
+	.globl __strlen_user
+	.ent __strlen_user
 	.frame sp, 0, ra
 
 	.align 3
-strlen_user:
+__strlen_user:
 	.prologue 0
 
 	EX( ldq_u t0, 0(a0) )	# load first quadword (a0 may be misaligned)
@@ -34,7 +34,7 @@
 	insqh   t1, a0, t1
 	andnot  a0, 7, v0
 	or      t1, t0, t0
-	nop			# dual issue the next two on ev5
+	subq	a0, 1, a0	# return "1+strlen" (0 for exception)
 	cmpbge  zero, t0, t1	# t1 <- bitmask: bit i == 1 <==> i-th byte == 0
 	bne     t1, $found
 
@@ -58,8 +58,10 @@
 	nop			# dual issue next two on ev4 and ev5
 
 	subq    v0, a0, v0
+	ret
 
 $exception:
+	mov	zero, v0
 	ret
 
-	.end strlen_user
+	.end __strlen_user

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