kallsyms: unify 32- and 64-bit code
[linux/fpc-iii.git] / include / asm-sh / uaccess.h
blobb3440c305b5d844cf58312e0654c3d515798d761
1 #ifndef __ASM_SH_UACCESS_H
2 #define __ASM_SH_UACCESS_H
4 #ifdef CONFIG_SUPERH32
5 # include "uaccess_32.h"
6 #else
7 # include "uaccess_64.h"
8 #endif
10 static inline unsigned long
11 copy_from_user(void *to, const void __user *from, unsigned long n)
13 unsigned long __copy_from = (unsigned long) from;
14 __kernel_size_t __copy_size = (__kernel_size_t) n;
16 if (__copy_size && __access_ok(__copy_from, __copy_size))
17 return __copy_user(to, from, __copy_size);
19 return __copy_size;
22 static inline unsigned long
23 copy_to_user(void __user *to, const void *from, unsigned long n)
25 unsigned long __copy_to = (unsigned long) to;
26 __kernel_size_t __copy_size = (__kernel_size_t) n;
28 if (__copy_size && __access_ok(__copy_to, __copy_size))
29 return __copy_user(to, from, __copy_size);
31 return __copy_size;
34 #endif /* __ASM_SH_UACCESS_H */