patch-2.1.7 linux/arch/alpha/lib/copy_user.S

Next file: linux/arch/alpha/lib/strncpy_from_user.S
Previous file: linux/arch/alpha/lib/clear_user.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.6/linux/arch/alpha/lib/copy_user.S linux/arch/alpha/lib/copy_user.S
@@ -18,7 +18,7 @@
  *	destination address in $6
  *	source address in $7
  *	exception pointer in $8
- *	return address in $28 (exceptions expect it there)
+ *	return address in $28
  *
  * Outputs:
  *	bytes left to copy in $0
@@ -27,28 +27,33 @@
  *	$1,$2,$3,$4,$5,$6,$7
  */
 
+/* Allow an exception for an insn; exit if we get one.  */
+#define EX(x,y...)			\
+	99: x,##y;			\
+	.section __ex_table,"a";	\
+	.gprel32 99b;			\
+	lda $31, $exit-99b($31);	\
+	.text
+
 	.set noat
 	.align 3
 	.globl __copy_user
 	.ent __copy_user
 __copy_user:
-	ldq $5,0($8)
-	beq $0,$35
 	and $6,7,$3
-	addq $5,1,$1
-	stq $1,0($8)
+	beq $0,$35
 	beq $3,$36
 	subq $3,8,$3
 	.align 5
 $37:
-	ldq_u $1,0($7)
-	ldq_u $2,0($6)
+	EX( ldq_u $1,0($7) )
+	EX( ldq_u $2,0($6) )
 	extbl $1,$7,$1
 	mskbl $2,$6,$2
 	insbl $1,$6,$1
 	addq $3,1,$3
 	bis $1,$2,$1
-	stq_u $1,0($6)
+	EX( stq_u $1,0($6) )
 	subq $0,1,$0
 	addq $6,1,$6
 	addq $7,1,$7
@@ -59,10 +64,10 @@
 	bic $0,7,$4
 	beq $1,$43
 	beq $4,$48
-	ldq_u $3,0($7)
+	EX( ldq_u $3,0($7) )
 	.align 5
 $50:
-	ldq_u $2,8($7)
+	EX( ldq_u $2,8($7) )
 	subq $4,8,$4
 	extql $3,$7,$3
 	extqh $2,$7,$1
@@ -77,13 +82,13 @@
 	beq $0,$41
 	.align 5
 $57:
-	ldq_u $1,0($7)
-	ldq_u $2,0($6)
+	EX( ldq_u $1,0($7) )
+	EX( ldq_u $2,0($6) )
 	extbl $1,$7,$1
 	mskbl $2,$6,$2
 	insbl $1,$6,$1
 	bis $1,$2,$1
-	stq_u $1,0($6)
+	EX( stq_u $1,0($6) )
 	subq $0,1,$0
 	addq $6,1,$6
 	addq $7,1,$7
@@ -93,9 +98,8 @@
 $43:
 	beq $4,$65
 	.align 5
-	.align 5
 $66:
-	ldq $1,0($7)
+	EX( ldq $1,0($7) )
 	subq $4,8,$4
 	stq $1,0($6)
 	addq $7,8,$7
@@ -104,15 +108,15 @@
 	bne $4,$66
 $65:
 	beq $0,$41
-	ldq $2,0($7)
-	ldq $1,0($6)
+	EX( ldq $2,0($7) )
+	EX( ldq $1,0($6) )
 	mskql $2,$0,$2
 	mskqh $1,$0,$1
 	bis $2,$1,$2
-	stq $2,0($6)
+	EX( stq $2,0($6) )
 	bis $31,$31,$0
 $41:
-	stq $5,0($8)
 $35:
+$exit:
 	ret $31,($28),1
 	.end __copy_user

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