1 #ifndef _ASM_X86_UACCESS_64_H
2 #define _ASM_X86_UACCESS_64_H
7 #include <linux/compiler.h>
8 #include <linux/errno.h>
11 #include <asm/cpufeature.h>
27 copy_user_generic(
void *to,
const void *
from,
unsigned len)
43 "1" (to),
"2" (from),
"3" (len)
44 :
"memory",
"rcx",
"r8",
"r9",
"r10",
"r11");
49 _copy_to_user(
void __user *to,
const void *from,
unsigned len);
53 copy_in_user(
void __user *to,
const void __user *from,
unsigned len);
56 const void __user *from,
62 if (
likely(sz == -1 || sz >= n))
64 #ifdef CONFIG_DEBUG_VM
66 WARN(1,
"Buffer overflow detected!\n");
85 if (!__builtin_constant_p(size))
86 return copy_user_generic(dst, (
__force void *)src, size);
89 ret,
"b",
"b",
"=q", 1);
92 ret,
"w",
"w",
"=r", 2);
95 ret,
"l",
"k",
"=r", 4);
98 ret,
"q",
"",
"=r", 8);
102 ret,
"q",
"",
"=r", 10);
106 (
u16 __user *)(8 + (
char __user *)src),
107 ret,
"w",
"w",
"=r", 2);
111 ret,
"q",
"",
"=r", 16);
115 (
u64 __user *)(8 + (
char __user *)src),
116 ret,
"q",
"",
"=r", 8);
119 return copy_user_generic(dst, (
__force void *)src, size);
124 int __copy_to_user(
void __user *dst,
const void *src,
unsigned size)
129 if (!__builtin_constant_p(size))
130 return copy_user_generic((
__force void *)dst, src, size);
133 ret,
"b",
"b",
"iq", 1);
136 ret,
"w",
"w",
"ir", 2);
139 ret,
"l",
"k",
"ir", 4);
142 ret,
"q",
"",
"er", 8);
146 ret,
"q",
"",
"er", 10);
151 ret,
"w",
"w",
"ir", 2);
155 ret,
"q",
"",
"er", 16);
160 ret,
"q",
"",
"er", 8);
163 return copy_user_generic((
__force void *)dst, src, size);
168 int __copy_in_user(
void __user *dst,
const void __user *src,
unsigned size)
173 if (!__builtin_constant_p(size))
174 return copy_user_generic((
__force void *)dst,
180 ret,
"b",
"b",
"=q", 1);
183 ret,
"b",
"b",
"iq", 1);
189 ret,
"w",
"w",
"=r", 2);
192 ret,
"w",
"w",
"ir", 2);
199 ret,
"l",
"k",
"=r", 4);
202 ret,
"l",
"k",
"ir", 4);
208 ret,
"q",
"",
"=r", 8);
211 ret,
"q",
"",
"er", 8);
215 return copy_user_generic((
__force void *)dst,
223 return copy_user_generic(dst, (
__force const void *)src, size);
229 return copy_user_generic((
__force void *)dst, src, size);
233 unsigned size,
int zerorest);
236 __copy_from_user_nocache(
void *dst,
const void __user *src,
unsigned size)
243 __copy_from_user_inatomic_nocache(
void *dst,
const void __user *src,