aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/uaccess.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/uaccess.h')
-rw-r--r--arch/x86/include/asm/uaccess.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index 68766b276d9e..a059aac9e937 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -319,10 +319,10 @@ do { \
319#define __get_user_asm_u64(x, ptr, retval, errret) \ 319#define __get_user_asm_u64(x, ptr, retval, errret) \
320({ \ 320({ \
321 __typeof__(ptr) __ptr = (ptr); \ 321 __typeof__(ptr) __ptr = (ptr); \
322 asm volatile(ASM_STAC "\n" \ 322 asm volatile("\n" \
323 "1: movl %2,%%eax\n" \ 323 "1: movl %2,%%eax\n" \
324 "2: movl %3,%%edx\n" \ 324 "2: movl %3,%%edx\n" \
325 "3: " ASM_CLAC "\n" \ 325 "3:\n" \
326 ".section .fixup,\"ax\"\n" \ 326 ".section .fixup,\"ax\"\n" \
327 "4: mov %4,%0\n" \ 327 "4: mov %4,%0\n" \
328 " xorl %%eax,%%eax\n" \ 328 " xorl %%eax,%%eax\n" \
@@ -331,7 +331,7 @@ do { \
331 ".previous\n" \ 331 ".previous\n" \
332 _ASM_EXTABLE(1b, 4b) \ 332 _ASM_EXTABLE(1b, 4b) \
333 _ASM_EXTABLE(2b, 4b) \ 333 _ASM_EXTABLE(2b, 4b) \
334 : "=r" (retval), "=A"(x) \ 334 : "=r" (retval), "=&A"(x) \
335 : "m" (__m(__ptr)), "m" __m(((u32 *)(__ptr)) + 1), \ 335 : "m" (__m(__ptr)), "m" __m(((u32 *)(__ptr)) + 1), \
336 "i" (errret), "0" (retval)); \ 336 "i" (errret), "0" (retval)); \
337}) 337})
@@ -703,14 +703,15 @@ extern struct movsl_mask {
703#define unsafe_put_user(x, ptr, err_label) \ 703#define unsafe_put_user(x, ptr, err_label) \
704do { \ 704do { \
705 int __pu_err; \ 705 int __pu_err; \
706 __put_user_size((x), (ptr), sizeof(*(ptr)), __pu_err, -EFAULT); \ 706 __typeof__(*(ptr)) __pu_val = (x); \
707 __put_user_size(__pu_val, (ptr), sizeof(*(ptr)), __pu_err, -EFAULT); \
707 if (unlikely(__pu_err)) goto err_label; \ 708 if (unlikely(__pu_err)) goto err_label; \
708} while (0) 709} while (0)
709 710
710#define unsafe_get_user(x, ptr, err_label) \ 711#define unsafe_get_user(x, ptr, err_label) \
711do { \ 712do { \
712 int __gu_err; \ 713 int __gu_err; \
713 unsigned long __gu_val; \ 714 __inttype(*(ptr)) __gu_val; \
714 __get_user_size(__gu_val, (ptr), sizeof(*(ptr)), __gu_err, -EFAULT); \ 715 __get_user_size(__gu_val, (ptr), sizeof(*(ptr)), __gu_err, -EFAULT); \
715 (x) = (__force __typeof__(*(ptr)))__gu_val; \ 716 (x) = (__force __typeof__(*(ptr)))__gu_val; \
716 if (unlikely(__gu_err)) goto err_label; \ 717 if (unlikely(__gu_err)) goto err_label; \