cgroup: superblock can't be released with active dentries
[firefly-linux-kernel-4.4.55.git] / arch / sparc / lib / strncpy_from_user_32.S
1 /* strncpy_from_user.S: Sparc strncpy from userspace.
2  *
3  *  Copyright(C) 1996 David S. Miller
4  */
5
6 #include <linux/linkage.h>
7 #include <asm/ptrace.h>
8 #include <asm/errno.h>
9
10         .text
11
12         /* Must return:
13          *
14          * -EFAULT              for an exception
15          * count                if we hit the buffer limit
16          * bytes copied         if we hit a null byte
17          */
18
19 ENTRY(__strncpy_from_user)
20         /* %o0=dest, %o1=src, %o2=count */
21         mov     %o2, %o3
22 1:
23         subcc   %o2, 1, %o2
24         bneg    2f
25          nop
26 10:
27         ldub    [%o1], %o4
28         add     %o0, 1, %o0
29         cmp     %o4, 0
30         add     %o1, 1, %o1
31         bne     1b
32          stb    %o4, [%o0 - 1]
33 2:
34         add     %o2, 1, %o0
35         retl
36          sub    %o3, %o0, %o0
37 ENDPROC(__strncpy_from_user)
38
39         .section .fixup,#alloc,#execinstr
40         .align  4
41 4:
42         retl
43          mov    -EFAULT, %o0
44
45         .section __ex_table,#alloc
46         .align  4
47         .word   10b, 4b