2 * arch/mips/lib/strncpy_user.S
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
8 * Copyright (c) 1996 by Ralf Baechle
10 * $Id: strncpy_user.S,v 1.2 1998/05/04 09:12:54 ralf Exp $
12 #include <linux/errno.h>
14 #include <asm/offset.h>
15 #include <asm/regdef.h>
17 #define EX(insn,reg,addr,handler) \
19 .section __ex_table,"a"; \
24 * Returns: -EFAULT if exception before terminator, N if the entire
25 * buffer filled, else strlen.
29 * Ugly special case have to check: we might get passed a user space
30 * pointer which wraps into the kernel space. We don't deal with that. If
31 * it happens at most some bytes of the exceptions handlers will be copied.
34 LEAF(__strncpy_from_user_asm)
35 lw v0, THREAD_CURDS($28) # pointer ok?
40 EXPORT(__strncpy_from_user_nocheck_asm)
44 1: EX(lbu, t0, (v1), fault)
56 END(__strncpy_from_user_asm)
61 .section __ex_table,"a"