diff options
author | Glauber Costa <gcosta@redhat.com> | 2008-06-25 11:48:47 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-09 03:14:24 -0400 |
commit | 3f168221167ca7a844fde3bf58e1c7ca0bf9741e (patch) | |
tree | ca51b618a7319488049b151d9e03d899170106df /include/asm-x86/uaccess_32.h | |
parent | 6fd4725d75c5049641640ce23fa5896501dfbd42 (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_32.h')
-rw-r--r-- | include/asm-x86/uaccess_32.h | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/include/asm-x86/uaccess_32.h b/include/asm-x86/uaccess_32.h index fab755781b9b..ebfe6b23ba57 100644 --- a/include/asm-x86/uaccess_32.h +++ b/include/asm-x86/uaccess_32.h | |||
@@ -145,47 +145,6 @@ extern void __put_user_8(void); | |||
145 | #define __put_user(x, ptr) \ | 145 | #define __put_user(x, ptr) \ |
146 | __put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr))) | 146 | __put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr))) |
147 | 147 | ||
148 | #define __get_user_nocheck(x, ptr, size) \ | ||
149 | ({ \ | ||
150 | long __gu_err; \ | ||
151 | unsigned long __gu_val; \ | ||
152 | __get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT); \ | ||
153 | (x) = (__typeof__(*(ptr)))__gu_val; \ | ||
154 | __gu_err; \ | ||
155 | }) | ||
156 | |||
157 | #define __get_user_size(x, ptr, size, retval, errret) \ | ||
158 | do { \ | ||
159 | retval = 0; \ | ||
160 | __chk_user_ptr(ptr); \ | ||
161 | switch (size) { \ | ||
162 | case 1: \ | ||
163 | __get_user_asm(x, ptr, retval, "b", "b", "=q", errret); \ | ||
164 | break; \ | ||
165 | case 2: \ | ||
166 | __get_user_asm(x, ptr, retval, "w", "w", "=r", errret); \ | ||
167 | break; \ | ||
168 | case 4: \ | ||
169 | __get_user_asm(x, ptr, retval, "l", "", "=r", errret); \ | ||
170 | break; \ | ||
171 | default: \ | ||
172 | (x) = __get_user_bad(); \ | ||
173 | } \ | ||
174 | } while (0) | ||
175 | |||
176 | #define __get_user_asm(x, addr, err, itype, rtype, ltype, errret) \ | ||
177 | asm volatile("1: mov"itype" %2,%"rtype"1\n" \ | ||
178 | "2:\n" \ | ||
179 | ".section .fixup,\"ax\"\n" \ | ||
180 | "3: movl %3,%0\n" \ | ||
181 | " xor"itype" %"rtype"1,%"rtype"1\n" \ | ||
182 | " jmp 2b\n" \ | ||
183 | ".previous\n" \ | ||
184 | _ASM_EXTABLE(1b, 3b) \ | ||
185 | : "=r" (err), ltype (x) \ | ||
186 | : "m" (__m(addr)), "i" (errret), "0" (err)) | ||
187 | |||
188 | |||
189 | unsigned long __must_check __copy_to_user_ll | 148 | unsigned long __must_check __copy_to_user_ll |
190 | (void __user *to, const void *from, unsigned long n); | 149 | (void __user *to, const void *from, unsigned long n); |
191 | unsigned long __must_check __copy_from_user_ll | 150 | unsigned long __must_check __copy_from_user_ll |