aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/uaccess_64.h
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-06-25 11:48:47 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-09 03:14:24 -0400
commit3f168221167ca7a844fde3bf58e1c7ca0bf9741e (patch)
treeca51b618a7319488049b151d9e03d899170106df /include/asm-x86/uaccess_64.h
parent6fd4725d75c5049641640ce23fa5896501dfbd42 (diff)
x86: merge __get_user_asm and its users.
Move __get_user_asm and __get_user_size and __get_user_nocheck to uaccess.h. This requires us to define a macro at __get_user_size for the 64-bit access case. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/uaccess_64.h')
-rw-r--r--include/asm-x86/uaccess_64.h43
1 files changed, 0 insertions, 43 deletions
diff --git a/include/asm-x86/uaccess_64.h b/include/asm-x86/uaccess_64.h
index e0875d7ae898..42a9769687e9 100644
--- a/include/asm-x86/uaccess_64.h
+++ b/include/asm-x86/uaccess_64.h
@@ -57,49 +57,6 @@ extern void __put_user_bad(void);
57 __pu_err; \ 57 __pu_err; \
58}) 58})
59 59
60#define __get_user_nocheck(x, ptr, size) \
61({ \
62 int __gu_err; \
63 unsigned long __gu_val; \
64 __get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT);\
65 (x) = (__force typeof(*(ptr)))__gu_val; \
66 __gu_err; \
67})
68
69#define __get_user_size(x, ptr, size, retval, errret) \
70do { \
71 retval = 0; \
72 __chk_user_ptr(ptr); \
73 switch (size) { \
74 case 1: \
75 __get_user_asm(x, ptr, retval, "b", "b", "=q", errret);\
76 break; \
77 case 2: \
78 __get_user_asm(x, ptr, retval, "w", "w", "=r", errret);\
79 break; \
80 case 4: \
81 __get_user_asm(x, ptr, retval, "l", "k", "=r", errret);\
82 break; \
83 case 8: \
84 __get_user_asm(x, ptr, retval, "q", "", "=r", errret); \
85 break; \
86 default: \
87 (x) = __get_user_bad(); \
88 } \
89} while (0)
90
91#define __get_user_asm(x, addr, err, itype, rtype, ltype, errno) \
92 asm volatile("1: mov"itype" %2,%"rtype"1\n" \
93 "2:\n" \
94 ".section .fixup, \"ax\"\n" \
95 "3: mov %3,%0\n" \
96 " xor"itype" %"rtype"1,%"rtype"1\n" \
97 " jmp 2b\n" \
98 ".previous\n" \
99 _ASM_EXTABLE(1b, 3b) \
100 : "=r" (err), ltype (x) \
101 : "m" (__m(addr)), "i"(errno), "0"(err))
102
103/* 60/*
104 * Copy To/From Userspace 61 * Copy To/From Userspace
105 */ 62 */