blob: c266227fdd5ba5320b2d0cfb318feab1b7815cb8 [file] [log] [blame]
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +10001#ifndef _ARCH_POWERPC_UACCESS_H
2#define _ARCH_POWERPC_UACCESS_H
3
4#ifdef __KERNEL__
5#ifndef __ASSEMBLY__
6
7#include <linux/sched.h>
8#include <linux/errno.h>
Michael Ellerman551c3c02008-07-17 17:17:52 +10009#include <asm/asm-compat.h>
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +100010#include <asm/processor.h>
Paul Mackerras6bfd93c2006-05-03 23:02:04 +100011#include <asm/page.h>
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +100012
13#define VERIFY_READ 0
14#define VERIFY_WRITE 1
15
16/*
17 * The fs value determines whether argument validity checking should be
18 * performed or not. If get_fs() == USER_DS, checking is performed, with
19 * get_fs() == KERNEL_DS, checking is bypassed.
20 *
21 * For historical reasons, these macros are grossly misnamed.
22 *
23 * The fs/ds values are now the highest legal address in the "segment".
24 * This simplifies the checking in the routines below.
25 */
26
27#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
28
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +100029#define KERNEL_DS MAKE_MM_SEG(~0UL)
Stephen Rothwell5015b492005-10-31 18:39:20 +110030#ifdef __powerpc64__
31/* We use TASK_SIZE_USER64 as TASK_SIZE is not constant */
32#define USER_DS MAKE_MM_SEG(TASK_SIZE_USER64 - 1)
33#else
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +100034#define USER_DS MAKE_MM_SEG(TASK_SIZE - 1)
35#endif
36
37#define get_ds() (KERNEL_DS)
38#define get_fs() (current->thread.fs)
39#define set_fs(val) (current->thread.fs = (val))
40
41#define segment_eq(a, b) ((a).seg == (b).seg)
42
Paul Mackerras16293722012-05-28 13:03:47 +100043#define user_addr_max() (get_fs().seg)
44
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +100045#ifdef __powerpc64__
46/*
Stephen Rothwell5015b492005-10-31 18:39:20 +110047 * This check is sufficient because there is a large enough
48 * gap between user addresses and the kernel addresses
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +100049 */
50#define __access_ok(addr, size, segment) \
Stephen Rothwell5015b492005-10-31 18:39:20 +110051 (((addr) <= (segment).seg) && ((size) <= (segment).seg))
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +100052
53#else
54
55#define __access_ok(addr, size, segment) \
56 (((addr) <= (segment).seg) && \
57 (((size) == 0) || (((size) - 1) <= ((segment).seg - (addr)))))
58
59#endif
60
61#define access_ok(type, addr, size) \
62 (__chk_user_ptr(addr), \
63 __access_ok((__force unsigned long)(addr), (size), get_fs()))
64
65/*
66 * The exception table consists of pairs of addresses: the first is the
67 * address of an instruction that is allowed to fault, and the second is
68 * the address at which the program should continue. No registers are
69 * modified, so it is entirely up to the continuation code to figure out
70 * what to do.
71 *
72 * All the routines below use bits of fixup code that are out of line
73 * with the main instruction path. This means when everything is well,
74 * we don't even have to jump over them. Further, they do not intrude
75 * on our cache or tlb entries.
76 */
77
78struct exception_table_entry {
79 unsigned long insn;
80 unsigned long fixup;
81};
82
83/*
84 * These are the main single-value transfer routines. They automatically
85 * use the right size if we just have the right pointer type.
86 *
87 * This gets kind of ugly. We want to return _two_ values in "get_user()"
88 * and yet we don't want to do any pointers, because that is too much
89 * of a performance impact. Thus we have a few rather ugly macros here,
90 * and hide all the ugliness from the user.
91 *
92 * The "__xxx" versions of the user access functions are versions that
93 * do not verify the address space, that must have been done previously
94 * with a separate "access_ok()" call (this is used when we do multiple
95 * accesses to the same area of user memory).
96 *
97 * As we use the same address space for kernel and user data on the
98 * PowerPC, we can just do these as direct assignments. (Of course, the
99 * exception handling means that it's no longer "just"...)
100 *
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000101 */
102#define get_user(x, ptr) \
103 __get_user_check((x), (ptr), sizeof(*(ptr)))
104#define put_user(x, ptr) \
105 __put_user_check((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
106
107#define __get_user(x, ptr) \
108 __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
109#define __put_user(x, ptr) \
110 __put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
Benjamin Herrenschmidte68c8252007-04-11 16:13:19 +1000111
Benjamin Herrenschmidte68c8252007-04-11 16:13:19 +1000112#define __get_user_inatomic(x, ptr) \
113 __get_user_nosleep((x), (ptr), sizeof(*(ptr)))
114#define __put_user_inatomic(x, ptr) \
115 __put_user_nosleep((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
116
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000117#define __get_user_unaligned __get_user
118#define __put_user_unaligned __put_user
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000119
120extern long __put_user_bad(void);
121
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000122/*
123 * We don't tell gcc that we are accessing memory, but this is OK
124 * because we do not write to any memory gcc knows about, so there
125 * are no aliasing issues.
126 */
127#define __put_user_asm(x, addr, err, op) \
128 __asm__ __volatile__( \
129 "1: " op " %1,0(%2) # put_user\n" \
130 "2:\n" \
131 ".section .fixup,\"ax\"\n" \
132 "3: li %0,%3\n" \
133 " b 2b\n" \
134 ".previous\n" \
135 ".section __ex_table,\"a\"\n" \
Michael Ellerman551c3c02008-07-17 17:17:52 +1000136 PPC_LONG_ALIGN "\n" \
David Gibson3ddfbcf2005-11-10 12:56:55 +1100137 PPC_LONG "1b,3b\n" \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000138 ".previous" \
139 : "=r" (err) \
Michael Ellerman551c3c02008-07-17 17:17:52 +1000140 : "r" (x), "b" (addr), "i" (-EFAULT), "0" (err))
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000141
Stephen Rothwell5015b492005-10-31 18:39:20 +1100142#ifdef __powerpc64__
143#define __put_user_asm2(x, ptr, retval) \
144 __put_user_asm(x, ptr, retval, "std")
145#else /* __powerpc64__ */
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000146#define __put_user_asm2(x, addr, err) \
147 __asm__ __volatile__( \
148 "1: stw %1,0(%2)\n" \
149 "2: stw %1+1,4(%2)\n" \
150 "3:\n" \
151 ".section .fixup,\"ax\"\n" \
152 "4: li %0,%3\n" \
153 " b 3b\n" \
154 ".previous\n" \
155 ".section __ex_table,\"a\"\n" \
Michael Ellerman551c3c02008-07-17 17:17:52 +1000156 PPC_LONG_ALIGN "\n" \
David Gibson3ddfbcf2005-11-10 12:56:55 +1100157 PPC_LONG "1b,4b\n" \
158 PPC_LONG "2b,4b\n" \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000159 ".previous" \
160 : "=r" (err) \
Michael Ellerman551c3c02008-07-17 17:17:52 +1000161 : "r" (x), "b" (addr), "i" (-EFAULT), "0" (err))
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000162#endif /* __powerpc64__ */
163
164#define __put_user_size(x, ptr, size, retval) \
165do { \
166 retval = 0; \
167 switch (size) { \
168 case 1: __put_user_asm(x, ptr, retval, "stb"); break; \
169 case 2: __put_user_asm(x, ptr, retval, "sth"); break; \
170 case 4: __put_user_asm(x, ptr, retval, "stw"); break; \
171 case 8: __put_user_asm2(x, ptr, retval); break; \
172 default: __put_user_bad(); \
173 } \
174} while (0)
175
176#define __put_user_nocheck(x, ptr, size) \
177({ \
178 long __pu_err; \
Paul Mackerras6bfd93c2006-05-03 23:02:04 +1000179 __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
180 if (!is_kernel_addr((unsigned long)__pu_addr)) \
Michael S. Tsirkin1af17172013-05-26 17:31:38 +0300181 might_fault(); \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000182 __chk_user_ptr(ptr); \
Paul Mackerras6bfd93c2006-05-03 23:02:04 +1000183 __put_user_size((x), __pu_addr, (size), __pu_err); \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000184 __pu_err; \
185})
186
187#define __put_user_check(x, ptr, size) \
188({ \
189 long __pu_err = -EFAULT; \
190 __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
Michael S. Tsirkin1af17172013-05-26 17:31:38 +0300191 might_fault(); \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000192 if (access_ok(VERIFY_WRITE, __pu_addr, size)) \
193 __put_user_size((x), __pu_addr, (size), __pu_err); \
194 __pu_err; \
195})
196
Benjamin Herrenschmidte68c8252007-04-11 16:13:19 +1000197#define __put_user_nosleep(x, ptr, size) \
198({ \
199 long __pu_err; \
200 __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
201 __chk_user_ptr(ptr); \
202 __put_user_size((x), __pu_addr, (size), __pu_err); \
203 __pu_err; \
204})
205
206
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000207extern long __get_user_bad(void);
208
209#define __get_user_asm(x, addr, err, op) \
210 __asm__ __volatile__( \
Stephen Rothwell5015b492005-10-31 18:39:20 +1100211 "1: "op" %1,0(%2) # get_user\n" \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000212 "2:\n" \
213 ".section .fixup,\"ax\"\n" \
214 "3: li %0,%3\n" \
215 " li %1,0\n" \
216 " b 2b\n" \
217 ".previous\n" \
218 ".section __ex_table,\"a\"\n" \
Michael Ellerman551c3c02008-07-17 17:17:52 +1000219 PPC_LONG_ALIGN "\n" \
David Gibson3ddfbcf2005-11-10 12:56:55 +1100220 PPC_LONG "1b,3b\n" \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000221 ".previous" \
222 : "=r" (err), "=r" (x) \
Michael Ellerman551c3c02008-07-17 17:17:52 +1000223 : "b" (addr), "i" (-EFAULT), "0" (err))
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000224
Stephen Rothwell5015b492005-10-31 18:39:20 +1100225#ifdef __powerpc64__
226#define __get_user_asm2(x, addr, err) \
227 __get_user_asm(x, addr, err, "ld")
228#else /* __powerpc64__ */
229#define __get_user_asm2(x, addr, err) \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000230 __asm__ __volatile__( \
231 "1: lwz %1,0(%2)\n" \
232 "2: lwz %1+1,4(%2)\n" \
233 "3:\n" \
234 ".section .fixup,\"ax\"\n" \
235 "4: li %0,%3\n" \
236 " li %1,0\n" \
237 " li %1+1,0\n" \
238 " b 3b\n" \
239 ".previous\n" \
240 ".section __ex_table,\"a\"\n" \
Michael Ellerman551c3c02008-07-17 17:17:52 +1000241 PPC_LONG_ALIGN "\n" \
David Gibson3ddfbcf2005-11-10 12:56:55 +1100242 PPC_LONG "1b,4b\n" \
243 PPC_LONG "2b,4b\n" \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000244 ".previous" \
245 : "=r" (err), "=&r" (x) \
Michael Ellerman551c3c02008-07-17 17:17:52 +1000246 : "b" (addr), "i" (-EFAULT), "0" (err))
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000247#endif /* __powerpc64__ */
248
249#define __get_user_size(x, ptr, size, retval) \
250do { \
251 retval = 0; \
252 __chk_user_ptr(ptr); \
Stephen Rothwell5015b492005-10-31 18:39:20 +1100253 if (size > sizeof(x)) \
254 (x) = __get_user_bad(); \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000255 switch (size) { \
256 case 1: __get_user_asm(x, ptr, retval, "lbz"); break; \
257 case 2: __get_user_asm(x, ptr, retval, "lhz"); break; \
258 case 4: __get_user_asm(x, ptr, retval, "lwz"); break; \
259 case 8: __get_user_asm2(x, ptr, retval); break; \
260 default: (x) = __get_user_bad(); \
261 } \
262} while (0)
263
264#define __get_user_nocheck(x, ptr, size) \
265({ \
266 long __gu_err; \
267 unsigned long __gu_val; \
Anton Blanchardb91c1e32015-05-26 08:53:25 +1000268 __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000269 __chk_user_ptr(ptr); \
Paul Mackerras6bfd93c2006-05-03 23:02:04 +1000270 if (!is_kernel_addr((unsigned long)__gu_addr)) \
Michael S. Tsirkin1af17172013-05-26 17:31:38 +0300271 might_fault(); \
Paul Mackerras6bfd93c2006-05-03 23:02:04 +1000272 __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000273 (x) = (__typeof__(*(ptr)))__gu_val; \
274 __gu_err; \
275})
276
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000277#define __get_user_check(x, ptr, size) \
278({ \
279 long __gu_err = -EFAULT; \
280 unsigned long __gu_val = 0; \
Anton Blanchardb91c1e32015-05-26 08:53:25 +1000281 __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
Michael S. Tsirkin1af17172013-05-26 17:31:38 +0300282 might_fault(); \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000283 if (access_ok(VERIFY_READ, __gu_addr, (size))) \
284 __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
Michael S. Tsirkin505e4282014-12-14 18:52:51 +0200285 (x) = (__force __typeof__(*(ptr)))__gu_val; \
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000286 __gu_err; \
287})
288
Benjamin Herrenschmidte68c8252007-04-11 16:13:19 +1000289#define __get_user_nosleep(x, ptr, size) \
290({ \
291 long __gu_err; \
292 unsigned long __gu_val; \
Anton Blanchardb91c1e32015-05-26 08:53:25 +1000293 __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
Benjamin Herrenschmidte68c8252007-04-11 16:13:19 +1000294 __chk_user_ptr(ptr); \
295 __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
Michael S. Tsirkin505e4282014-12-14 18:52:51 +0200296 (x) = (__force __typeof__(*(ptr)))__gu_val; \
Benjamin Herrenschmidte68c8252007-04-11 16:13:19 +1000297 __gu_err; \
298})
299
300
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000301/* more complex routines */
302
303extern unsigned long __copy_tofrom_user(void __user *to,
304 const void __user *from, unsigned long size);
305
306#ifndef __powerpc64__
Stephen Rothwell5015b492005-10-31 18:39:20 +1100307
Adrian Bunk4cfbdff2006-12-01 12:53:18 +0100308static inline unsigned long copy_from_user(void *to,
Stephen Rothwell5015b492005-10-31 18:39:20 +1100309 const void __user *from, unsigned long n)
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000310{
Al Viro22426462016-08-21 19:16:26 -0400311 if (likely(access_ok(VERIFY_READ, from, n))) {
Kees Cook81409e92016-08-31 16:04:21 -0700312 check_object_size(to, n, false);
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000313 return __copy_tofrom_user((__force void __user *)to, from, n);
Kees Cook1d3c1322016-06-23 15:10:01 -0700314 }
Al Viro22426462016-08-21 19:16:26 -0400315 memset(to, 0, n);
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000316 return n;
317}
318
Adrian Bunk4cfbdff2006-12-01 12:53:18 +0100319static inline unsigned long copy_to_user(void __user *to,
Stephen Rothwell5015b492005-10-31 18:39:20 +1100320 const void *from, unsigned long n)
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000321{
Kees Cook1d3c1322016-06-23 15:10:01 -0700322 if (access_ok(VERIFY_WRITE, to, n)) {
Kees Cook81409e92016-08-31 16:04:21 -0700323 check_object_size(from, n, true);
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000324 return __copy_tofrom_user(to, (__force void __user *)from, n);
Kees Cook1d3c1322016-06-23 15:10:01 -0700325 }
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000326 return n;
327}
328
329#else /* __powerpc64__ */
330
Stephen Rothwell5015b492005-10-31 18:39:20 +1100331#define __copy_in_user(to, from, size) \
332 __copy_tofrom_user((to), (from), (size))
333
334extern unsigned long copy_from_user(void *to, const void __user *from,
335 unsigned long n);
336extern unsigned long copy_to_user(void __user *to, const void *from,
337 unsigned long n);
338extern unsigned long copy_in_user(void __user *to, const void __user *from,
339 unsigned long n);
340
Stephen Rothwell48fe4872005-11-01 15:53:19 +1100341#endif /* __powerpc64__ */
342
Stephen Rothwell5015b492005-10-31 18:39:20 +1100343static inline unsigned long __copy_from_user_inatomic(void *to,
344 const void __user *from, unsigned long n)
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000345{
346 if (__builtin_constant_p(n) && (n <= 8)) {
Nate Case9c8387a2008-05-13 06:14:14 +1000347 unsigned long ret = 1;
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000348
349 switch (n) {
350 case 1:
351 __get_user_size(*(u8 *)to, from, 1, ret);
352 break;
353 case 2:
354 __get_user_size(*(u16 *)to, from, 2, ret);
355 break;
356 case 4:
357 __get_user_size(*(u32 *)to, from, 4, ret);
358 break;
359 case 8:
360 __get_user_size(*(u64 *)to, from, 8, ret);
361 break;
362 }
Stephen Rothwell48fe4872005-11-01 15:53:19 +1100363 if (ret == 0)
364 return 0;
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000365 }
Kees Cook1d3c1322016-06-23 15:10:01 -0700366
Kees Cook81409e92016-08-31 16:04:21 -0700367 check_object_size(to, n, false);
Kees Cook1d3c1322016-06-23 15:10:01 -0700368
Stephen Rothwell48fe4872005-11-01 15:53:19 +1100369 return __copy_tofrom_user((__force void __user *)to, from, n);
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000370}
371
Stephen Rothwell5015b492005-10-31 18:39:20 +1100372static inline unsigned long __copy_to_user_inatomic(void __user *to,
373 const void *from, unsigned long n)
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000374{
375 if (__builtin_constant_p(n) && (n <= 8)) {
Nate Case9c8387a2008-05-13 06:14:14 +1000376 unsigned long ret = 1;
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000377
378 switch (n) {
379 case 1:
380 __put_user_size(*(u8 *)from, (u8 __user *)to, 1, ret);
381 break;
382 case 2:
383 __put_user_size(*(u16 *)from, (u16 __user *)to, 2, ret);
384 break;
385 case 4:
386 __put_user_size(*(u32 *)from, (u32 __user *)to, 4, ret);
387 break;
388 case 8:
389 __put_user_size(*(u64 *)from, (u64 __user *)to, 8, ret);
390 break;
391 }
Stephen Rothwell48fe4872005-11-01 15:53:19 +1100392 if (ret == 0)
393 return 0;
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000394 }
Kees Cook81409e92016-08-31 16:04:21 -0700395
396 check_object_size(from, n, true);
Kees Cook1d3c1322016-06-23 15:10:01 -0700397
Stephen Rothwell48fe4872005-11-01 15:53:19 +1100398 return __copy_tofrom_user(to, (__force const void __user *)from, n);
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000399}
400
Stephen Rothwell5015b492005-10-31 18:39:20 +1100401static inline unsigned long __copy_from_user(void *to,
402 const void __user *from, unsigned long size)
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000403{
Michael S. Tsirkin1af17172013-05-26 17:31:38 +0300404 might_fault();
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000405 return __copy_from_user_inatomic(to, from, size);
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000406}
407
Stephen Rothwell5015b492005-10-31 18:39:20 +1100408static inline unsigned long __copy_to_user(void __user *to,
409 const void *from, unsigned long size)
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000410{
Michael S. Tsirkin1af17172013-05-26 17:31:38 +0300411 might_fault();
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000412 return __copy_to_user_inatomic(to, from, size);
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000413}
414
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000415extern unsigned long __clear_user(void __user *addr, unsigned long size);
416
417static inline unsigned long clear_user(void __user *addr, unsigned long size)
418{
Michael S. Tsirkin1af17172013-05-26 17:31:38 +0300419 might_fault();
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000420 if (likely(access_ok(VERIFY_WRITE, addr, size)))
421 return __clear_user(addr, size);
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000422 return size;
423}
424
Paul Mackerras16293722012-05-28 13:03:47 +1000425extern long strncpy_from_user(char *dst, const char __user *src, long count);
426extern __must_check long strlen_user(const char __user *str);
427extern __must_check long strnlen_user(const char __user *str, long n);
Stephen Rothwell2df5e8b2005-10-29 17:51:31 +1000428
429#endif /* __ASSEMBLY__ */
430#endif /* __KERNEL__ */
431
432#endif /* _ARCH_POWERPC_UACCESS_H */