Lines Matching +full:0 +full:- +full:9 +full:a +full:- +full:f
1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
25 * copy a null terminated string from userspace.
32 " cmpnei %3, 0 \n" \
33 " bf 4f \n" \
34 "1: cmpnei %1, 0 \n" \
35 " bf 5f \n" \
36 "2: ldb %4, (%3, 0) \n" \
37 " stb %4, (%2, 0) \n" \
38 " cmpnei %4, 0 \n" \
39 " bf 3f \n" \
44 "3: subu %0, %1 \n" \
45 " br 5f \n" \
46 "4: mov %0, %5 \n" \
47 " br 5f \n" \
48 ".section __ex_table, \"a\" \n" \
55 : "5"(-EFAULT), "0"(count), "1"(count), \
58 } while (0)
61 * __strncpy_from_user: - Copy a NUL terminated string from userspace,
68 * Copies a NUL-terminated string from userspace to kernel space.
75 * If access to userspace fails, returns -EFAULT (some data may have been
91 * strncpy_from_user: - Copy a NUL terminated string from userspace.
97 * Copies a NUL-terminated string from userspace to kernel space.
102 * If access to userspace fails, returns -EFAULT (some data may have been
110 long res = -EFAULT; in strncpy_from_user()
119 * strlen_user: - Get the size of a string in user space.
123 * Get the size of a NUL-terminated string in user space.
126 * On exception, returns 0.
127 * If the string is too long, returns a value greater than @n.
134 return 0; in strnlen_user()
137 " cmpnei %1, 0 \n" in strnlen_user()
138 " bf 3f \n" in strnlen_user()
139 "1: cmpnei %0, 0 \n" in strnlen_user()
140 " bf 3f \n" in strnlen_user()
141 "2: ldb %3, (%1, 0) \n" in strnlen_user()
142 " cmpnei %3, 0 \n" in strnlen_user()
143 " bf 3f \n" in strnlen_user()
144 " subi %0, 1 \n" in strnlen_user()
147 "3: subu %2, %0 \n" in strnlen_user()
149 " br 5f \n" in strnlen_user()
150 "4: movi %0, 0 \n" in strnlen_user()
151 " br 5f \n" in strnlen_user()
152 ".section __ex_table, \"a\" \n" in strnlen_user()
158 : "0"(n), "1"(s), "2"(n) in strnlen_user()
170 "0: cmpnei %1, 0 \n" \
171 " bf 7f \n" \
174 " cmpnei %3, 0 \n" \
175 " bf 1f \n" \
176 " br 5f \n" \
177 "1: cmplti %0, 32 \n" /* 4W */ \
178 " bt 3f \n" \
179 "8: stw %2, (%1, 0) \n" \
188 " subi %0, 32 \n" \
190 "3: cmplti %0, 4 \n" /* 1W */ \
191 " bt 5f \n" \
192 "4: stw %2, (%1, 0) \n" \
194 " subi %0, 4 \n" \
196 "5: cmpnei %0, 0 \n" /* 1B */ \
197 "9: bf 7f \n" \
198 "6: stb %2, (%1, 0) \n" \
200 " subi %0, 1 \n" \
202 ".section __ex_table,\"a\" \n" \
204 ".long 8b, 9b \n" \
205 ".long 10b, 9b \n" \
206 ".long 11b, 9b \n" \
207 ".long 12b, 9b \n" \
208 ".long 13b, 9b \n" \
209 ".long 14b, 9b \n" \
210 ".long 15b, 9b \n" \
211 ".long 16b, 9b \n" \
212 ".long 4b, 9b \n" \
213 ".long 6b, 9b \n" \
218 : "0"(size), "1"(addr), "2"(0) \
220 } while (0)
223 * clear_user: - Zero a block of memory in user space.
227 * Zero a block of memory in user space.
242 * __clear_user: - Zero a block of memory in user space, with less checking.
246 * Zero a block of memory in user space. Caller must check