#define ARCH_HAS_SEARCH_EXTABLE
struct uaccess_ops {
- size_t (*copy_from_user)(size_t, const void __user *, void *);
- size_t (*copy_to_user)(size_t, void __user *, const void *);
- size_t (*copy_in_user)(size_t, void __user *, const void __user *);
- size_t (*clear_user)(size_t, void __user *);
- size_t (*strnlen_user)(size_t, const char __user *);
- size_t (*strncpy_from_user)(size_t, const char __user *, char *);
+ size_t (*copy_from_user)(void *, const void __user *, size_t);
+ size_t (*copy_to_user)(void __user *, const void *, size_t);
+ size_t (*copy_in_user)(void __user *, const void __user *, size_t);
+ size_t (*clear_user)(void __user *, size_t);
+ size_t (*strnlen_user)(const char __user *, size_t);
+ size_t (*strncpy_from_user)(char *, const char __user *, size_t);
int (*futex_atomic_op)(int op, u32 __user *, int oparg, int *old);
int (*futex_atomic_cmpxchg)(u32 *, u32 __user *, u32 old, u32 new);
};
extern int __handle_fault(unsigned long, unsigned long, int);
-static inline int __put_user_fn(size_t size, void __user *ptr, void *x)
+static inline int __put_user_fn(void *x, void __user *ptr, size_t size)
{
- size = uaccess.copy_to_user(size, ptr, x);
+ size = uaccess.copy_to_user(ptr, x, size);
return size ? -EFAULT : size;
}
-static inline int __get_user_fn(size_t size, const void __user *ptr, void *x)
+static inline int __get_user_fn(void *x, const void __user *ptr, size_t size)
{
- size = uaccess.copy_from_user(size, ptr, x);
+ size = uaccess.copy_from_user(x, ptr, size);
return size ? -EFAULT : size;
}
case 2: \
case 4: \
case 8: \
- __pu_err = __put_user_fn(sizeof (*(ptr)), \
- ptr, &__x); \
+ __pu_err = __put_user_fn(&__x, ptr, \
+ sizeof(*(ptr))); \
break; \
default: \
__put_user_bad(); \
switch (sizeof(*(ptr))) { \
case 1: { \
unsigned char __x; \
- __gu_err = __get_user_fn(sizeof (*(ptr)), \
- ptr, &__x); \
+ __gu_err = __get_user_fn(&__x, ptr, \
+ sizeof(*(ptr))); \
(x) = *(__force __typeof__(*(ptr)) *) &__x; \
break; \
}; \
case 2: { \
unsigned short __x; \
- __gu_err = __get_user_fn(sizeof (*(ptr)), \
- ptr, &__x); \
+ __gu_err = __get_user_fn(&__x, ptr, \
+ sizeof(*(ptr))); \
(x) = *(__force __typeof__(*(ptr)) *) &__x; \
break; \
}; \
case 4: { \
unsigned int __x; \
- __gu_err = __get_user_fn(sizeof (*(ptr)), \
- ptr, &__x); \
+ __gu_err = __get_user_fn(&__x, ptr, \
+ sizeof(*(ptr))); \
(x) = *(__force __typeof__(*(ptr)) *) &__x; \
break; \
}; \
case 8: { \
unsigned long long __x; \
- __gu_err = __get_user_fn(sizeof (*(ptr)), \
- ptr, &__x); \
+ __gu_err = __get_user_fn(&__x, ptr, \
+ sizeof(*(ptr))); \
(x) = *(__force __typeof__(*(ptr)) *) &__x; \
break; \
}; \
static inline unsigned long __must_check
__copy_to_user(void __user *to, const void *from, unsigned long n)
{
- return uaccess.copy_to_user(n, to, from);
+ return uaccess.copy_to_user(to, from, n);
}
#define __copy_to_user_inatomic __copy_to_user
static inline unsigned long __must_check
__copy_from_user(void *to, const void __user *from, unsigned long n)
{
- return uaccess.copy_from_user(n, from, to);
+ return uaccess.copy_from_user(to, from, n);
}
extern void copy_from_user_overflow(void)
static inline unsigned long __must_check
__copy_in_user(void __user *to, const void __user *from, unsigned long n)
{
- return uaccess.copy_in_user(n, to, from);
+ return uaccess.copy_in_user(to, from, n);
}
static inline unsigned long __must_check
strncpy_from_user(char *dst, const char __user *src, long count)
{
might_fault();
- return uaccess.strncpy_from_user(count, src, dst);
+ return uaccess.strncpy_from_user(dst, src, count);
}
static inline unsigned long
strnlen_user(const char __user * src, unsigned long n)
{
might_fault();
- return uaccess.strnlen_user(n, src);
+ return uaccess.strnlen_user(src, n);
}
/**
static inline unsigned long __must_check
__clear_user(void __user *to, unsigned long n)
{
- return uaccess.clear_user(n, to);
+ return uaccess.clear_user(to, n);
}
static inline unsigned long __must_check
clear_user(void __user *to, unsigned long n)
{
might_fault();
- return uaccess.clear_user(n, to);
+ return uaccess.clear_user(to, n);
}
extern int copy_to_user_real(void __user *dest, void *src, size_t count);
#define SLR "slgr"
#endif
-static size_t copy_from_user_mvcos(size_t size, const void __user *ptr, void *x)
+static size_t copy_from_user_mvcos(void *x, const void __user *ptr, size_t size)
{
register unsigned long reg0 asm("0") = 0x81UL;
unsigned long tmp1, tmp2;
return size;
}
-static size_t copy_to_user_mvcos(size_t size, void __user *ptr, const void *x)
+static size_t copy_to_user_mvcos(void __user *ptr, const void *x, size_t size)
{
register unsigned long reg0 asm("0") = 0x810000UL;
unsigned long tmp1, tmp2;
return size;
}
-static size_t copy_in_user_mvcos(size_t size, void __user *to,
- const void __user *from)
+static size_t copy_in_user_mvcos(void __user *to, const void __user *from,
+ size_t size)
{
register unsigned long reg0 asm("0") = 0x810081UL;
unsigned long tmp1, tmp2;
return size;
}
-static size_t clear_user_mvcos(size_t size, void __user *to)
+static size_t clear_user_mvcos(void __user *to, size_t size)
{
register unsigned long reg0 asm("0") = 0x810000UL;
unsigned long tmp1, tmp2;
return size;
}
-static size_t strnlen_user_mvcos(size_t count, const char __user *src)
+static size_t strnlen_user_mvcos(const char __user *src, size_t count)
{
size_t done, len, offset, len_str;
char buf[256];
offset = (size_t)src & ~PAGE_MASK;
len = min(256UL, PAGE_SIZE - offset);
len = min(count - done, len);
- if (copy_from_user_mvcos(len, src, buf))
+ if (copy_from_user_mvcos(buf, src, len))
return 0;
len_str = strnlen(buf, len);
done += len_str;
return done + 1;
}
-static size_t strncpy_from_user_mvcos(size_t count, const char __user *src,
- char *dst)
+static size_t strncpy_from_user_mvcos(char *dst, const char __user *src,
+ size_t count)
{
size_t done, len, offset, len_str;
do {
offset = (size_t)src & ~PAGE_MASK;
len = min(count - done, PAGE_SIZE - offset);
- if (copy_from_user_mvcos(len, src, dst))
+ if (copy_from_user_mvcos(dst, src, len))
return -EFAULT;
len_str = strnlen(dst, len);
done += len_str;
#define SLR "slgr"
#endif
-static size_t strnlen_kernel(size_t count, const char __user *src)
+static size_t strnlen_kernel(const char __user *src, size_t count)
{
register unsigned long reg0 asm("0") = 0UL;
unsigned long tmp1, tmp2;
return count;
}
-static size_t copy_in_kernel(size_t count, void __user *to,
- const void __user *from)
+static size_t copy_in_kernel(void __user *to, const void __user *from,
+ size_t count)
{
unsigned long tmp1;
return 0;
}
-static size_t copy_from_user_pt(size_t n, const void __user *from, void *to)
+static size_t copy_from_user_pt(void *to, const void __user *from, size_t n)
{
size_t rc;
if (segment_eq(get_fs(), KERNEL_DS))
- return copy_in_kernel(n, (void __user *) to, from);
+ return copy_in_kernel((void __user *) to, from, n);
rc = __user_copy_pt((unsigned long) from, to, n, 0);
if (unlikely(rc))
memset(to + n - rc, 0, rc);
return rc;
}
-static size_t copy_to_user_pt(size_t n, void __user *to, const void *from)
+static size_t copy_to_user_pt(void __user *to, const void *from, size_t n)
{
if (segment_eq(get_fs(), KERNEL_DS))
- return copy_in_kernel(n, to, (void __user *) from);
+ return copy_in_kernel(to, (void __user *) from, n);
return __user_copy_pt((unsigned long) to, (void *) from, n, 1);
}
-static size_t clear_user_pt(size_t n, void __user *to)
+static size_t clear_user_pt(void __user *to, size_t n)
{
void *zpage = (void *) empty_zero_page;
long done, size, ret;
else
size = n - done;
if (segment_eq(get_fs(), KERNEL_DS))
- ret = copy_in_kernel(n, to, (void __user *) zpage);
+ ret = copy_in_kernel(to, (void __user *) zpage, n);
else
ret = __user_copy_pt((unsigned long) to, zpage, size, 1);
done += size;
return 0;
}
-static size_t strnlen_user_pt(size_t count, const char __user *src)
+static size_t strnlen_user_pt(const char __user *src, size_t count)
{
unsigned long uaddr = (unsigned long) src;
struct mm_struct *mm = current->mm;
if (unlikely(!count))
return 0;
if (segment_eq(get_fs(), KERNEL_DS))
- return strnlen_kernel(count, src);
+ return strnlen_kernel(src, count);
if (!mm)
return 0;
done = 0;
goto retry;
}
-static size_t strncpy_from_user_pt(size_t count, const char __user *src,
- char *dst)
+static size_t strncpy_from_user_pt(char *dst, const char __user *src,
+ size_t count)
{
size_t done, len, offset, len_str;
offset = (size_t)src & ~PAGE_MASK;
len = min(count - done, PAGE_SIZE - offset);
if (segment_eq(get_fs(), KERNEL_DS)) {
- if (copy_in_kernel(len, (void __user *) dst, src))
+ if (copy_in_kernel((void __user *) dst, src, len))
return -EFAULT;
} else {
if (__user_copy_pt((unsigned long) src, dst, len, 0))
return done;
}
-static size_t copy_in_user_pt(size_t n, void __user *to,
- const void __user *from)
+static size_t copy_in_user_pt(void __user *to, const void __user *from,
+ size_t n)
{
struct mm_struct *mm = current->mm;
unsigned long offset_max, uaddr, done, size, error_code;
int write_user;
if (segment_eq(get_fs(), KERNEL_DS))
- return copy_in_kernel(n, to, from);
+ return copy_in_kernel(to, from, n);
if (!mm)
return n;
done = 0;