Lines Matching +full:x +full:- +full:size

1 /* SPDX-License-Identifier: GPL-2.0 */
15 #include <asm-generic/access_ok.h>
17 /* Uh, these should become the main single-value transfer routines..
18 * They automatically use the right size if we just have the right
26 #define put_user(x, ptr) ({ \ argument
29 __put_user_check((__typeof__(*(ptr)))(x), __pu_addr, sizeof(*(ptr))); \
32 #define get_user(x, ptr) ({ \ argument
35 __get_user_check((x), __gu_addr, sizeof(*(ptr)), __typeof__(*(ptr))); \
43 #define __put_user(x, ptr) \ argument
44 __put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
45 #define __get_user(x, ptr) \ argument
46 __get_user_nocheck((x), (ptr), sizeof(*(ptr)), __typeof__(*(ptr)))
49 #define __m(x) ((struct __large_struct __user *)(x)) argument
51 #define __put_user_check(x, addr, size) ({ \ argument
53 if (__access_ok(addr, size)) { \
54 switch (size) { \
56 __put_user_asm(x, b, addr, __pu_ret); \
59 __put_user_asm(x, h, addr, __pu_ret); \
62 __put_user_asm(x, , addr, __pu_ret); \
65 __put_user_asm(x, d, addr, __pu_ret); \
72 __pu_ret = -EFAULT; \
77 #define __put_user_nocheck(x, addr, size) ({ \ argument
79 switch (size) { \
80 case 1: __put_user_asm(x, b, addr, __pu_ret); break; \
81 case 2: __put_user_asm(x, h, addr, __pu_ret); break; \
82 case 4: __put_user_asm(x, , addr, __pu_ret); break; \
83 case 8: __put_user_asm(x, d, addr, __pu_ret); break; \
89 #define __put_user_asm(x, size, addr, ret) \ argument
92 "1:\t" "st"#size " %1, %2\n\t" \
106 : "=&r" (ret) : "r" (x), "m" (*__m(addr)), \
107 "i" (-EFAULT))
111 #define __get_user_check(x, addr, size, type) ({ \ argument
114 if (__access_ok(addr, size)) { \
115 switch (size) { \
135 __gu_ret = -EFAULT; \
137 x = (__force type) __gu_val; \
141 #define __get_user_nocheck(x, addr, size, type) ({ \ argument
144 switch (size) { \
154 x = (__force type) __gu_val; \
158 #define __get_user_asm(x, size, addr, ret) \ argument
161 "1:\t" "ld"#size " %2, %1\n\t" \
176 : "=&r" (ret), "=&r" (x) : "m" (*__m(addr)), \
177 "i" (-EFAULT))
181 unsigned long __copy_user(void __user *to, const void __user *from, unsigned long size);
196 static inline unsigned long __clear_user(void __user *addr, unsigned long size) in __clear_user() argument
205 : "=r" (ret) : "r" (addr), "r" (size) : in __clear_user()