X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fasm-sh%2Fuaccess.h;h=b3440c305b5d844cf58312e0654c3d515798d761;hb=4bd27972e2c35b1e9e672ff05e0a781644f9c905;hp=ff24ce95b2384b055a999303235f75fb7c0056ab;hpb=c64768a7d671bcde80bca2aed93f9e07edc069c3;p=linux-2.6 diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h index ff24ce95b2..b3440c305b 100644 --- a/include/asm-sh/uaccess.h +++ b/include/asm-sh/uaccess.h @@ -1,5 +1,34 @@ +#ifndef __ASM_SH_UACCESS_H +#define __ASM_SH_UACCESS_H + #ifdef CONFIG_SUPERH32 # include "uaccess_32.h" #else # include "uaccess_64.h" #endif + +static inline unsigned long +copy_from_user(void *to, const void __user *from, unsigned long n) +{ + unsigned long __copy_from = (unsigned long) from; + __kernel_size_t __copy_size = (__kernel_size_t) n; + + if (__copy_size && __access_ok(__copy_from, __copy_size)) + return __copy_user(to, from, __copy_size); + + return __copy_size; +} + +static inline unsigned long +copy_to_user(void __user *to, const void *from, unsigned long n) +{ + unsigned long __copy_to = (unsigned long) to; + __kernel_size_t __copy_size = (__kernel_size_t) n; + + if (__copy_size && __access_ok(__copy_to, __copy_size)) + return __copy_user(to, from, __copy_size); + + return __copy_size; +} + +#endif /* __ASM_SH_UACCESS_H */