9e31639f9669061786ec8b5b7a4b535923c1d6fd
[linux-2.6.git] / include / asm-i386 / uaccess.h
1 #ifndef __i386_UACCESS_H
2 #define __i386_UACCESS_H
3
4 /*
5  * User space memory access functions
6  */
7 #include <linux/config.h>
8 #include <linux/errno.h>
9 #include <linux/thread_info.h>
10 #include <linux/prefetch.h>
11 #include <linux/string.h>
12 #include <linux/compiler.h>
13 #include <asm/page.h>
14
15 #define VERIFY_READ 0
16 #define VERIFY_WRITE 1
17
18 /*
19  * The fs value determines whether argument validity checking should be
20  * performed or not.  If get_fs() == USER_DS, checking is performed, with
21  * get_fs() == KERNEL_DS, checking is bypassed.
22  *
23  * For historical reasons, these macros are grossly misnamed.
24  */
25
26 #define MAKE_MM_SEG(s)  ((mm_segment_t) { (s) })
27
28
29 #define KERNEL_DS       MAKE_MM_SEG(0xFFFFFFFFUL)
30 #define USER_DS         MAKE_MM_SEG(TASK_SIZE)
31
32 #define get_ds()        (KERNEL_DS)
33 #define get_fs()        (current_thread_info()->addr_limit)
34 #define set_fs(x)       (current_thread_info()->addr_limit = (x))
35
36 #define segment_eq(a,b) ((a).seg == (b).seg)
37
38 extern long not_a_user_address;
39 #define check_user_ptr(x) \
40         (void) ({ void __user * __userptr = (__typeof__(*(x)) *)&not_a_user_address; __userptr; })
41
42 /*
43  * movsl can be slow when source and dest are not both 8-byte aligned
44  */
45 #ifdef CONFIG_X86_INTEL_USERCOPY
46 extern struct movsl_mask {
47         int mask;
48 } ____cacheline_aligned_in_smp movsl_mask;
49 #endif
50
51 #define __addr_ok(addr) ((unsigned long __force)(addr) < (current_thread_info()->addr_limit.seg))
52
53 /*
54  * Test whether a block of memory is a valid user space address.
55  * Returns 0 if the range is valid, nonzero otherwise.
56  *
57  * This is equivalent to the following test:
58  * (u33)addr + (u33)size >= (u33)current->addr_limit.seg
59  *
60  * This needs 33-bit arithmetic. We have a carry...
61  */
62 #define __range_ok(addr,size) ({ \
63         unsigned long flag,sum; \
64         check_user_ptr(addr); \
65         asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \
66                 :"=&r" (flag), "=r" (sum) \
67                 :"1" (addr),"g" ((int)(size)),"g" (current_thread_info()->addr_limit.seg)); \
68         flag; })
69
70 /**
71  * access_ok: - Checks if a user space pointer is valid
72  * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE.  Note that
73  *        %VERIFY_WRITE is a superset of %VERIFY_READ - if it is safe
74  *        to write to a block, it is always safe to read from it.
75  * @addr: User space pointer to start of block to check
76  * @size: Size of block to check
77  *
78  * Context: User context only.  This function may sleep.
79  *
80  * Checks if a pointer to a block of memory in user space is valid.
81  *
82  * Returns true (nonzero) if the memory block may be valid, false (zero)
83  * if it is definitely invalid.
84  *
85  * Note that, depending on architecture, this function probably just
86  * checks that the pointer is in the user space range - after calling
87  * this function, memory access functions may still return -EFAULT.
88  */
89 #define access_ok(type,addr,size) (likely(__range_ok(addr,size) == 0))
90
91 /**
92  * verify_area: - Obsolete, use access_ok()
93  * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE
94  * @addr: User space pointer to start of block to check
95  * @size: Size of block to check
96  *
97  * Context: User context only.  This function may sleep.
98  *
99  * This function has been replaced by access_ok().
100  *
101  * Checks if a pointer to a block of memory in user space is valid.
102  *
103  * Returns zero if the memory block may be valid, -EFAULT
104  * if it is definitely invalid.
105  *
106  * See access_ok() for more details.
107  */
108 static inline int verify_area(int type, const void __user * addr, unsigned long size)
109 {
110         return access_ok(type,addr,size) ? 0 : -EFAULT;
111 }
112
113
114 /*
115  * The exception table consists of pairs of addresses: the first is the
116  * address of an instruction that is allowed to fault, and the second is
117  * the address at which the program should continue.  No registers are
118  * modified, so it is entirely up to the continuation code to figure out
119  * what to do.
120  *
121  * All the routines below use bits of fixup code that are out of line
122  * with the main instruction path.  This means when everything is well,
123  * we don't even have to jump over them.  Further, they do not intrude
124  * on our cache or tlb entries.
125  */
126
127 struct exception_table_entry
128 {
129         unsigned long insn, fixup;
130 };
131
132 extern int fixup_exception(struct pt_regs *regs);
133
134 /*
135  * These are the main single-value transfer routines.  They automatically
136  * use the right size if we just have the right pointer type.
137  *
138  * This gets kind of ugly. We want to return _two_ values in "get_user()"
139  * and yet we don't want to do any pointers, because that is too much
140  * of a performance impact. Thus we have a few rather ugly macros here,
141  * and hide all the ugliness from the user.
142  *
143  * The "__xxx" versions of the user access functions are versions that
144  * do not verify the address space, that must have been done previously
145  * with a separate "access_ok()" call (this is used when we do multiple
146  * accesses to the same area of user memory).
147  */
148
149 extern void __get_user_1(void);
150 extern void __get_user_2(void);
151 extern void __get_user_4(void);
152
153 #define __get_user_x(size,ret,x,ptr) \
154         __asm__ __volatile__("call __get_user_" #size \
155                 :"=a" (ret),"=d" (x) \
156                 :"0" (ptr))
157
158 extern int get_user_size(unsigned int size, void *val, const void *ptr);
159 extern int put_user_size(unsigned int size, const void *val, void *ptr);
160 extern int zero_user_size(unsigned int size, void *ptr);
161 extern int copy_str_fromuser_size(unsigned int size, void *val, const void *ptr);
162 extern int strlen_fromuser_size(unsigned int size, const void *ptr);
163
164
165 # define indirect_get_user(x,ptr)                                       \
166 ({      int __ret_gu,__val_gu;                                          \
167         __typeof__(ptr) __ptr_gu = (ptr);                               \
168         __ret_gu = get_user_size(sizeof(*__ptr_gu), &__val_gu,__ptr_gu) ? -EFAULT : 0;\
169         (x) = (__typeof__(*__ptr_gu))__val_gu;                          \
170         __ret_gu;                                                       \
171 })
172 #define indirect_put_user(x,ptr)                                        \
173 ({                                                                      \
174         __typeof__(*(ptr)) *__ptr_pu = (ptr), __x_pu = (x);             \
175         put_user_size(sizeof(*__ptr_pu), &__x_pu, __ptr_pu) ? -EFAULT : 0; \
176 })
177 #define __indirect_put_user indirect_put_user
178 #define __indirect_get_user indirect_get_user
179
180 #define indirect_copy_from_user(to,from,n) get_user_size(n,to,from)
181 #define indirect_copy_to_user(to,from,n) put_user_size(n,from,to)
182
183 #define __indirect_copy_from_user indirect_copy_from_user
184 #define __indirect_copy_to_user indirect_copy_to_user
185
186 #define indirect_strncpy_from_user(dst, src, count) \
187                 copy_str_fromuser_size(count, dst, src)
188
189 extern int strlen_fromuser_size(unsigned int size, const void *ptr);
190 #define indirect_strnlen_user(str, n) strlen_fromuser_size(n, str)
191 #define indirect_strlen_user(str) indirect_strnlen_user(str, ~0UL >> 1)
192
193 extern int zero_user_size(unsigned int size, void *ptr);
194
195 #define indirect_clear_user(mem, len) zero_user_size(len, mem)
196 #define __indirect_clear_user clear_user
197
198 /* Careful: we have to cast the result to the type of the pointer for sign reasons */
199 /**
200  * get_user: - Get a simple variable from user space.
201  * @x:   Variable to store result.
202  * @ptr: Source address, in user space.
203  *
204  * Context: User context only.  This function may sleep.
205  *
206  * This macro copies a single simple variable from user space to kernel
207  * space.  It supports simple types like char and int, but not larger
208  * data types like structures or arrays.
209  *
210  * @ptr must have pointer-to-simple-variable type, and the result of
211  * dereferencing @ptr must be assignable to @x without a cast.
212  *
213  * Returns zero on success, or -EFAULT on error.
214  * On error, the variable @x is set to zero.
215  */
216 #define direct_get_user(x,ptr)                                          \
217 ({      int __ret_gu,__val_gu;                                          \
218         check_user_ptr(ptr);                                            \
219         switch(sizeof (*(ptr))) {                                       \
220         case 1:  __get_user_x(1,__ret_gu,__val_gu,ptr); break;          \
221         case 2:  __get_user_x(2,__ret_gu,__val_gu,ptr); break;          \
222         case 4:  __get_user_x(4,__ret_gu,__val_gu,ptr); break;          \
223         default: __get_user_x(X,__ret_gu,__val_gu,ptr); break;          \
224         }                                                               \
225         (x) = (__typeof__(*(ptr)))__val_gu;                             \
226         __ret_gu;                                                       \
227 })
228
229 extern void __put_user_bad(void);
230
231 /**
232  * put_user: - Write a simple value into user space.
233  * @x:   Value to copy to user space.
234  * @ptr: Destination address, in user space.
235  *
236  * Context: User context only.  This function may sleep.
237  *
238  * This macro copies a single simple value from kernel space to user
239  * space.  It supports simple types like char and int, but not larger
240  * data types like structures or arrays.
241  *
242  * @ptr must have pointer-to-simple-variable type, and @x must be assignable
243  * to the result of dereferencing @ptr.
244  *
245  * Returns zero on success, or -EFAULT on error.
246  */
247 #define direct_put_user(x,ptr)                                          \
248   __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
249
250
251 /**
252  * __get_user: - Get a simple variable from user space, with less checking.
253  * @x:   Variable to store result.
254  * @ptr: Source address, in user space.
255  *
256  * Context: User context only.  This function may sleep.
257  *
258  * This macro copies a single simple variable from user space to kernel
259  * space.  It supports simple types like char and int, but not larger
260  * data types like structures or arrays.
261  *
262  * @ptr must have pointer-to-simple-variable type, and the result of
263  * dereferencing @ptr must be assignable to @x without a cast.
264  *
265  * Caller must check the pointer with access_ok() before calling this
266  * function.
267  *
268  * Returns zero on success, or -EFAULT on error.
269  * On error, the variable @x is set to zero.
270  */
271 #define __direct_get_user(x,ptr) \
272   __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
273
274
275 /**
276  * __put_user: - Write a simple value into user space, with less checking.
277  * @x:   Value to copy to user space.
278  * @ptr: Destination address, in user space.
279  *
280  * Context: User context only.  This function may sleep.
281  *
282  * This macro copies a single simple value from kernel space to user
283  * space.  It supports simple types like char and int, but not larger
284  * data types like structures or arrays.
285  *
286  * @ptr must have pointer-to-simple-variable type, and @x must be assignable
287  * to the result of dereferencing @ptr.
288  *
289  * Caller must check the pointer with access_ok() before calling this
290  * function.
291  *
292  * Returns zero on success, or -EFAULT on error.
293  */
294 #define __direct_put_user(x,ptr) \
295   __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
296
297 #define __put_user_nocheck(x,ptr,size)                          \
298 ({                                                              \
299         long __pu_err;                                          \
300         __put_user_size((x),(ptr),(size),__pu_err,-EFAULT);     \
301         __pu_err;                                               \
302 })
303
304
305 #define __put_user_check(x,ptr,size)                                    \
306 ({                                                                      \
307         long __pu_err = -EFAULT;                                        \
308         __typeof__(*(ptr)) *__pu_addr = (ptr);                          \
309         might_sleep();                                          \
310         if (access_ok(VERIFY_WRITE,__pu_addr,size))                     \
311                 __put_user_size((x),__pu_addr,(size),__pu_err,-EFAULT); \
312         __pu_err;                                                       \
313 })                                                      
314
315 #define __put_user_u64(x, addr, err)                            \
316         __asm__ __volatile__(                                   \
317                 "1:     movl %%eax,0(%2)\n"                     \
318                 "2:     movl %%edx,4(%2)\n"                     \
319                 "3:\n"                                          \
320                 ".section .fixup,\"ax\"\n"                      \
321                 "4:     movl %3,%0\n"                           \
322                 "       jmp 3b\n"                               \
323                 ".previous\n"                                   \
324                 ".section __ex_table,\"a\"\n"                   \
325                 "       .align 4\n"                             \
326                 "       .long 1b,4b\n"                          \
327                 "       .long 2b,4b\n"                          \
328                 ".previous"                                     \
329                 : "=r"(err)                                     \
330                 : "A" (x), "r" (addr), "i"(-EFAULT), "0"(err))
331
332 #ifdef CONFIG_X86_WP_WORKS_OK
333
334 #define __put_user_size(x,ptr,size,retval,errret)                       \
335 do {                                                                    \
336         retval = 0;                                                     \
337         check_user_ptr(ptr);                                            \
338         switch (size) {                                                 \
339         case 1: __put_user_asm(x,ptr,retval,"b","b","iq",errret);break; \
340         case 2: __put_user_asm(x,ptr,retval,"w","w","ir",errret);break; \
341         case 4: __put_user_asm(x,ptr,retval,"l","","ir",errret); break; \
342         case 8: __put_user_u64((__typeof__(*ptr))(x),ptr,retval); break;\
343           default: __put_user_bad();                                    \
344         }                                                               \
345 } while (0)
346
347 #else
348
349 #define __put_user_size(x,ptr,size,retval,errret)                       \
350 do {                                                                    \
351         __typeof__(*(ptr)) __pus_tmp = x;                               \
352         retval = 0;                                                     \
353                                                                         \
354         if(unlikely(__copy_to_user_ll(ptr, &__pus_tmp, size) != 0))     \
355                 retval = errret;                                        \
356 } while (0)
357
358 #endif
359 struct __large_struct { unsigned long buf[100]; };
360 #define __m(x) (*(struct __large_struct *)(x))
361
362 /*
363  * Tell gcc we read from memory instead of writing: this is because
364  * we do not write to any memory gcc knows about, so there are no
365  * aliasing issues.
366  */
367 #define __put_user_asm(x, addr, err, itype, rtype, ltype, errret)       \
368         __asm__ __volatile__(                                           \
369                 "1:     mov"itype" %"rtype"1,%2\n"                      \
370                 "2:\n"                                                  \
371                 ".section .fixup,\"ax\"\n"                              \
372                 "3:     movl %3,%0\n"                                   \
373                 "       jmp 2b\n"                                       \
374                 ".previous\n"                                           \
375                 ".section __ex_table,\"a\"\n"                           \
376                 "       .align 4\n"                                     \
377                 "       .long 1b,3b\n"                                  \
378                 ".previous"                                             \
379                 : "=r"(err)                                             \
380                 : ltype (x), "m"(__m(addr)), "i"(errret), "0"(err))
381
382
383 #define __get_user_nocheck(x,ptr,size)                          \
384 ({                                                              \
385         long __gu_err, __gu_val;                                \
386         __get_user_size(__gu_val,(ptr),(size),__gu_err,-EFAULT);\
387         (x) = (__typeof__(*(ptr)))__gu_val;                     \
388         __gu_err;                                               \
389 })
390
391 extern long __get_user_bad(void);
392
393 #define __get_user_size(x,ptr,size,retval,errret)                       \
394 do {                                                                    \
395         retval = 0;                                                     \
396         check_user_ptr(ptr);                                            \
397         switch (size) {                                                 \
398         case 1: __get_user_asm(x,ptr,retval,"b","b","=q",errret);break; \
399         case 2: __get_user_asm(x,ptr,retval,"w","w","=r",errret);break; \
400         case 4: __get_user_asm(x,ptr,retval,"l","","=r",errret);break;  \
401         default: (x) = __get_user_bad();                                \
402         }                                                               \
403 } while (0)
404
405 #define __get_user_asm(x, addr, err, itype, rtype, ltype, errret)       \
406         __asm__ __volatile__(                                           \
407                 "1:     mov"itype" %2,%"rtype"1\n"                      \
408                 "2:\n"                                                  \
409                 ".section .fixup,\"ax\"\n"                              \
410                 "3:     movl %3,%0\n"                                   \
411                 "       xor"itype" %"rtype"1,%"rtype"1\n"               \
412                 "       jmp 2b\n"                                       \
413                 ".previous\n"                                           \
414                 ".section __ex_table,\"a\"\n"                           \
415                 "       .align 4\n"                                     \
416                 "       .long 1b,3b\n"                                  \
417                 ".previous"                                             \
418                 : "=r"(err), ltype (x)                                  \
419                 : "m"(__m(addr)), "i"(errret), "0"(err))
420
421
422 unsigned long __must_check __copy_to_user_ll(void __user *to, const void *from, unsigned long n);
423 unsigned long __must_check __copy_from_user_ll(void *to, const void __user *from, unsigned long n);
424
425 /*
426  * Here we special-case 1, 2 and 4-byte copy_*_user invocations.  On a fault
427  * we return the initial request size (1, 2 or 4), as copy_*_user should do.
428  * If a store crosses a page boundary and gets a fault, the x86 will not write
429  * anything, so this is accurate.
430  */
431
432 /**
433  * __copy_to_user: - Copy a block of data into user space, with less checking.
434  * @to:   Destination address, in user space.
435  * @from: Source address, in kernel space.
436  * @n:    Number of bytes to copy.
437  *
438  * Context: User context only.  This function may sleep.
439  *
440  * Copy data from kernel space to user space.  Caller must check
441  * the specified block with access_ok() before calling this function.
442  *
443  * Returns number of bytes that could not be copied.
444  * On success, this will be zero.
445  */
446 static inline unsigned long __must_check
447 __direct_copy_to_user(void __user *to, const void *from, unsigned long n)
448 {
449         if (__builtin_constant_p(n)) {
450                 unsigned long ret;
451
452                 switch (n) {
453                 case 1:
454                         __put_user_size(*(u8 *)from, (u8 __user *)to, 1, ret, 1);
455                         return ret;
456                 case 2:
457                         __put_user_size(*(u16 *)from, (u16 __user *)to, 2, ret, 2);
458                         return ret;
459                 case 4:
460                         __put_user_size(*(u32 *)from, (u32 __user *)to, 4, ret, 4);
461                         return ret;
462                 }
463         }
464         return __copy_to_user_ll(to, from, n);
465 }
466
467 /**
468  * __copy_from_user: - Copy a block of data from user space, with less checking.
469  * @to:   Destination address, in kernel space.
470  * @from: Source address, in user space.
471  * @n:    Number of bytes to copy.
472  *
473  * Context: User context only.  This function may sleep.
474  *
475  * Copy data from user space to kernel space.  Caller must check
476  * the specified block with access_ok() before calling this function.
477  *
478  * Returns number of bytes that could not be copied.
479  * On success, this will be zero.
480  *
481  * If some data could not be copied, this function will pad the copied
482  * data to the requested size using zero bytes.
483  */
484 static inline unsigned long __must_check
485 __direct_copy_from_user(void *to, const void __user *from, unsigned long n)
486 {
487         if (__builtin_constant_p(n)) {
488                 unsigned long ret;
489
490                 switch (n) {
491                 case 1:
492                         __get_user_size(*(u8 *)to, from, 1, ret, 1);
493                         return ret;
494                 case 2:
495                         __get_user_size(*(u16 *)to, from, 2, ret, 2);
496                         return ret;
497                 case 4:
498                         __get_user_size(*(u32 *)to, from, 4, ret, 4);
499                         return ret;
500                 }
501         }
502         return __copy_from_user_ll(to, from, n);
503 }
504
505 /**
506  * copy_to_user: - Copy a block of data into user space.
507  * @to:   Destination address, in user space.
508  * @from: Source address, in kernel space.
509  * @n:    Number of bytes to copy.
510  *
511  * Context: User context only.  This function may sleep.
512  *
513  * Copy data from kernel space to user space.
514  *
515  * Returns number of bytes that could not be copied.
516  * On success, this will be zero.
517  */
518 static inline unsigned long __must_check
519 direct_copy_to_user(void __user *to, const void *from, unsigned long n)
520 {
521         might_sleep();
522         if (access_ok(VERIFY_WRITE, to, n))
523                 n = __direct_copy_to_user(to, from, n);
524         return n;
525 }
526
527 /**
528  * copy_from_user: - Copy a block of data from user space.
529  * @to:   Destination address, in kernel space.
530  * @from: Source address, in user space.
531  * @n:    Number of bytes to copy.
532  *
533  * Context: User context only.  This function may sleep.
534  *
535  * Copy data from user space to kernel space.
536  *
537  * Returns number of bytes that could not be copied.
538  * On success, this will be zero.
539  *
540  * If some data could not be copied, this function will pad the copied
541  * data to the requested size using zero bytes.
542  */
543 static inline unsigned long __must_check
544 direct_copy_from_user(void *to, const void __user *from, unsigned long n)
545 {
546         might_sleep();
547         if (access_ok(VERIFY_READ, from, n))
548                 n = __direct_copy_from_user(to, from, n);
549         else
550                 memset(to, 0, n);
551         return n;
552 }
553
554 long strncpy_from_user(char *dst, const char __user *src, long count);
555 long __strncpy_from_user(char *dst, const char __user *src, long count);
556
557 /**
558  * strlen_user: - Get the size of a string in user space.
559  * @str: The string to measure.
560  *
561  * Context: User context only.  This function may sleep.
562  *
563  * Get the size of a NUL-terminated string in user space.
564  *
565  * Returns the size of the string INCLUDING the terminating NUL.
566  * On exception, returns 0.
567  *
568  * If there is a limit on the length of a valid string, you may wish to
569  * consider using strnlen_user() instead.
570  */
571
572 long direct_strncpy_from_user(char *dst, const char *src, long count);
573 long __direct_strncpy_from_user(char *dst, const char *src, long count);
574 #define direct_strlen_user(str) direct_strnlen_user(str, ~0UL >> 1)
575 long direct_strnlen_user(const char *str, long n);
576 unsigned long direct_clear_user(void *mem, unsigned long len);
577 unsigned long __direct_clear_user(void *mem, unsigned long len);
578
579 extern int indirect_uaccess;
580
581 #ifdef CONFIG_X86_UACCESS_INDIRECT
582
583 /*
584  * Return code and zeroing semantics:
585
586  __clear_user          0                      <-> bytes not done
587  clear_user            0                      <-> bytes not done
588  __copy_to_user        0                      <-> bytes not done
589  copy_to_user          0                      <-> bytes not done
590  __copy_from_user      0                      <-> bytes not done, zero rest
591  copy_from_user        0                      <-> bytes not done, zero rest
592  __get_user            0                      <-> -EFAULT
593  get_user              0                      <-> -EFAULT
594  __put_user            0                      <-> -EFAULT
595  put_user              0                      <-> -EFAULT
596  strlen_user           strlen + 1             <-> 0
597  strnlen_user          strlen + 1 (or n+1)    <-> 0
598  strncpy_from_user     strlen (or n)          <-> -EFAULT
599
600  */
601
602 #define __clear_user(mem,len) __indirect_clear_user(mem,len)
603 #define clear_user(mem,len) indirect_clear_user(mem,len)
604 #define __copy_to_user(to,from,n) __indirect_copy_to_user(to,from,n)
605 #define copy_to_user(to,from,n) indirect_copy_to_user(to,from,n)
606 #define __copy_from_user(to,from,n) __indirect_copy_from_user(to,from,n)
607 #define copy_from_user(to,from,n) indirect_copy_from_user(to,from,n)
608 #define __get_user(val,ptr) __indirect_get_user(val,ptr)
609 #define get_user(val,ptr) indirect_get_user(val,ptr)
610 #define __put_user(val,ptr) __indirect_put_user(val,ptr)
611 #define put_user(val,ptr) indirect_put_user(val,ptr)
612 #define strlen_user(str) indirect_strlen_user(str)
613 #define strnlen_user(src,count) indirect_strnlen_user(src,count)
614 #define strncpy_from_user(dst,src,count) \
615                         indirect_strncpy_from_user(dst,src,count)
616
617 #else
618
619 #define __clear_user __direct_clear_user
620 #define clear_user direct_clear_user
621 #define __copy_to_user __direct_copy_to_user
622 #define copy_to_user direct_copy_to_user
623 #define __copy_from_user __direct_copy_from_user
624 #define copy_from_user direct_copy_from_user
625 #define __get_user __direct_get_user
626 #define get_user direct_get_user
627 #define __put_user __direct_put_user
628 #define put_user direct_put_user
629 #define strlen_user direct_strlen_user
630 #define strnlen_user direct_strnlen_user
631 #define strncpy_from_user direct_strncpy_from_user
632
633 #endif /* CONFIG_X86_UACCESS_INDIRECT */
634
635 #endif /* __i386_UACCESS_H */