2008-02-07 03:50:52 -07:00
|
|
|
#ifndef __ASM_SH_UACCESS_H
|
|
|
|
#define __ASM_SH_UACCESS_H
|
|
|
|
|
2007-11-10 03:55:50 -07:00
|
|
|
#ifdef CONFIG_SUPERH32
|
|
|
|
# include "uaccess_32.h"
|
2005-04-16 16:20:36 -06:00
|
|
|
#else
|
2007-11-10 03:55:50 -07:00
|
|
|
# include "uaccess_64.h"
|
2005-04-16 16:20:36 -06:00
|
|
|
#endif
|
2008-02-07 03:50:52 -07:00
|
|
|
|
|
|
|
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 */
|