diff options
author | Glauber Costa <gcosta@redhat.com> | 2008-06-25 10:05:11 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-09 03:14:18 -0400 |
commit | 865e5b76505cdade261773bde32f785b3ce579f1 (patch) | |
tree | 3ac122f2b95162b286b1a136ec4460f422b0d8b9 /include/asm-x86/uaccess_32.h | |
parent | ca23386216b9d4fc3bb211101205077d2b2916ae (diff) |
x86: merge getuser.
Merge versions of getuser from uaccess_32.h and uaccess_64.h into
uaccess.h. There is a part which is 64-bit only (for now), and for
that, we use a __get_user_8 macro.
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 | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/include/asm-x86/uaccess_32.h b/include/asm-x86/uaccess_32.h index 92ad19e70989..3cc323694438 100644 --- a/include/asm-x86/uaccess_32.h +++ b/include/asm-x86/uaccess_32.h | |||
@@ -24,49 +24,6 @@ extern struct movsl_mask { | |||
24 | ((unsigned long __force)(addr) < \ | 24 | ((unsigned long __force)(addr) < \ |
25 | (current_thread_info()->addr_limit.seg)) | 25 | (current_thread_info()->addr_limit.seg)) |
26 | 26 | ||
27 | /* Careful: we have to cast the result to the type of the pointer | ||
28 | * for sign reasons */ | ||
29 | |||
30 | /** | ||
31 | * get_user: - Get a simple variable from user space. | ||
32 | * @x: Variable to store result. | ||
33 | * @ptr: Source address, in user space. | ||
34 | * | ||
35 | * Context: User context only. This function may sleep. | ||
36 | * | ||
37 | * This macro copies a single simple variable from user space to kernel | ||
38 | * space. It supports simple types like char and int, but not larger | ||
39 | * data types like structures or arrays. | ||
40 | * | ||
41 | * @ptr must have pointer-to-simple-variable type, and the result of | ||
42 | * dereferencing @ptr must be assignable to @x without a cast. | ||
43 | * | ||
44 | * Returns zero on success, or -EFAULT on error. | ||
45 | * On error, the variable @x is set to zero. | ||
46 | */ | ||
47 | #define get_user(x, ptr) \ | ||
48 | ({ \ | ||
49 | int __ret_gu; \ | ||
50 | unsigned long __val_gu; \ | ||
51 | __chk_user_ptr(ptr); \ | ||
52 | switch (sizeof(*(ptr))) { \ | ||
53 | case 1: \ | ||
54 | __get_user_x(1, __ret_gu, __val_gu, ptr); \ | ||
55 | break; \ | ||
56 | case 2: \ | ||
57 | __get_user_x(2, __ret_gu, __val_gu, ptr); \ | ||
58 | break; \ | ||
59 | case 4: \ | ||
60 | __get_user_x(4, __ret_gu, __val_gu, ptr); \ | ||
61 | break; \ | ||
62 | default: \ | ||
63 | __get_user_x(X, __ret_gu, __val_gu, ptr); \ | ||
64 | break; \ | ||
65 | } \ | ||
66 | (x) = (__typeof__(*(ptr)))__val_gu; \ | ||
67 | __ret_gu; \ | ||
68 | }) | ||
69 | |||
70 | extern void __put_user_bad(void); | 27 | extern void __put_user_bad(void); |
71 | 28 | ||
72 | /* | 29 | /* |