diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-12-04 03:58:56 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-12-04 03:58:56 +0000 |
commit | 1d67e90f19a7acfd9a05dc59678e7d0c5090bd0d (patch) | |
tree | 357efc7b93f8f5102110d20d293f41360ec212fc /arch/mips/lib/strncpy_user.S | |
parent | aea27b2e18d69af87e673972246e66657b4fa274 (diff) |
Merge with Linux 2.3.21.
Diffstat (limited to 'arch/mips/lib/strncpy_user.S')
-rw-r--r-- | arch/mips/lib/strncpy_user.S | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/arch/mips/lib/strncpy_user.S b/arch/mips/lib/strncpy_user.S index 231ff8c9d..9c8e0ab85 100644 --- a/arch/mips/lib/strncpy_user.S +++ b/arch/mips/lib/strncpy_user.S @@ -1,4 +1,4 @@ -/* $Id: strncpy_user.S,v 1.2 1998/05/04 09:12:54 ralf Exp $ +/* $Id: strncpy_user.S,v 1.3 1999/08/21 22:19:11 ralf Exp $ * * 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 @@ -29,32 +29,31 @@ */ LEAF(__strncpy_from_user_asm) - LONG_L v0, THREAD_CURDS($28) # pointer ok? - LONG_SUBU v0, zero, v0 - and v0, a1 - not v0 - beqz v0, fault + lw v0, THREAD_CURDS($28) # pointer ok? + and v0, a1 + bltz v0, fault + EXPORT(__strncpy_from_user_nocheck_asm) - move v0,zero - move v1,a1 - .set noreorder + move v0, zero + move v1, a1 + .set noreorder 1: EX(lbu, t0, (v1), fault) - LONG_ADDIU v1,1 - beqz t0,2f - sb t0,(a0) - LONG_ADDIU v0,1 - bne v0,a2,1b - LONG_ADDIU a0,1 - .set reorder -2: LONG_ADDU t0,a1,v0 - xor t0,a1 - bltz t0,fault - jr ra # return n + addiu v1, v1, 1 + beqz t0, 2f + sb t0, (a0) + addiu v0, 1 + bne v0, a2, 1b + addiu a0, 1 + .set reorder +2: addu t0, a1, v0 + xor t0, a1 + bltz t0, fault + jr ra # return n END(__strncpy_from_user_asm) -fault: li v0, -EFAULT - jr ra +fault: li v0, -EFAULT + jr ra - .section __ex_table,"a" - PTR 1b, fault + .section __ex_table,"a" + PTR 1b, fault .previous |