#define access_ok(type,addr,size) __access_ok(addr,size)
-extern inline int verify_area(int type, const void * addr, unsigned long size)
+extern inline int verify_area(int type, const void __user *addr,
+ unsigned long size)
{
- return access_ok(type,addr,size)?0:-EFAULT;
+ return access_ok(type, addr, size) ? 0 : -EFAULT;
}
/*
* These are the main single-value transfer routines. They automatically
* use the right size if we just have the right pointer type.
*/
-#if __GNUC__ > 2
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
#define __put_user_asm(x, ptr, err) \
({ \
err = 0; \
})
#endif
+#ifndef __CHECKER__
#define __put_user(x, ptr) \
({ \
__typeof__(*(ptr)) __x = (x); \
} \
__pu_err; \
})
+#else
+#define __put_user(x, ptr) \
+({ \
+ void __user *p; \
+ p = (ptr); \
+ 0; \
+})
+#endif
#define put_user(x, ptr) \
({ \
extern int __put_user_bad(void);
-#if __GNUC__ > 2
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
#define __get_user_asm(x, ptr, err) \
({ \
err = 0; \
})
#endif
+#ifndef __CHECKER__
#define __get_user(x, ptr) \
({ \
__typeof__(*(ptr)) __x; \
(x) = __x; \
__gu_err; \
})
+#else
+#define __get_user(x, ptr) \
+({ \
+ void __user *p; \
+ p = (ptr); \
+ 0; \
+})
+#endif
+
#define get_user(x, ptr) \
({ \
extern int __get_user_bad(void);
-extern long __copy_to_user_asm(const void *from, long n, void *to);
+#define __put_user_unaligned __put_user
+#define __get_user_unaligned __get_user
+
+extern long __copy_to_user_asm(const void *from, long n, void __user *to);
/**
* __copy_to_user: - Copy a block of data into user space, with less checking.
return __copy_to_user_asm(from, n, to);
}
+#define __copy_to_user_inatomic __copy_to_user
+#define __copy_from_user_inatomic __copy_from_user
+
/**
* copy_to_user: - Copy a block of data into user space.
* @to: Destination address, in user space.
return n;
}
-extern long __copy_from_user_asm(void *to, long n, const void *from);
+extern long __copy_from_user_asm(void *to, long n, const void __user *from);
/**
* __copy_from_user: - Copy a block of data from user space, with less checking.
return n;
}
-extern long __copy_in_user_asm(const void *from, long n, void *to);
+extern unsigned long __copy_in_user_asm(const void __user *from, long n,
+ void __user *to);
static inline unsigned long
__copy_in_user(void __user *to, const void __user *from, unsigned long n)
{
- __copy_in_user_asm(from, n, to);
+ return __copy_in_user_asm(from, n, to);
}
static inline unsigned long
/*
* Copy a null terminated string from userspace.
*/
-extern long __strncpy_from_user_asm(char *dst, const char *src, long count);
+extern long __strncpy_from_user_asm(long count, char *dst,
+ const char __user *src);
static inline long
-strncpy_from_user(char *dst, const char *src, long count)
+strncpy_from_user(char *dst, const char __user *src, long count)
{
long res = -EFAULT;
might_sleep();
if (access_ok(VERIFY_READ, src, 1))
- res = __strncpy_from_user_asm(dst, src, count);
+ res = __strncpy_from_user_asm(count, dst, src);
return res;
}
-extern long __strnlen_user_asm(const char *src, long count);
+extern long __strnlen_user_asm(long count, const char __user *src);
static inline unsigned long
-strnlen_user(const char * src, unsigned long n)
+strnlen_user(const char __user * src, unsigned long n)
{
might_sleep();
- return __strnlen_user_asm(src, n);
+ return __strnlen_user_asm(n, src);
}
/**
* Zero Userspace
*/
-extern long __clear_user_asm(void *to, long n);
+extern long __clear_user_asm(void __user *to, long n);
static inline unsigned long
-__clear_user(void *to, unsigned long n)
+__clear_user(void __user *to, unsigned long n)
{
return __clear_user_asm(to, n);
}
static inline unsigned long
-clear_user(void *to, unsigned long n)
+clear_user(void __user *to, unsigned long n)
{
might_sleep();
if (access_ok(VERIFY_WRITE, to, n))