aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/uaccess_64.h
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-06-25 11:00:44 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-09 03:14:22 -0400
commitd42e6af613375be7a9a431628ecd742e87230554 (patch)
treed2994222bc235db7241989248e607a84642039d4 /include/asm-x86/uaccess_64.h
parent293e6a2524ae775fef41d21d17af288d4b2ee91e (diff)
x86: don't always use EFAULT on __put_user_size.
Let the user of the macro specify the desired return. 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.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/asm-x86/uaccess_64.h b/include/asm-x86/uaccess_64.h
index 81308763a4c1..6532d638d5a3 100644
--- a/include/asm-x86/uaccess_64.h
+++ b/include/asm-x86/uaccess_64.h
@@ -37,7 +37,7 @@ extern void __put_user_bad(void);
37#define __put_user_nocheck(x, ptr, size) \ 37#define __put_user_nocheck(x, ptr, size) \
38({ \ 38({ \
39 int __pu_err; \ 39 int __pu_err; \
40 __put_user_size((x), (ptr), (size), __pu_err); \ 40 __put_user_size((x), (ptr), (size), __pu_err, -EFAULT); \
41 __pu_err; \ 41 __pu_err; \
42}) 42})
43 43
@@ -65,22 +65,22 @@ extern void __put_user_bad(void);
65 __pu_err; \ 65 __pu_err; \
66}) 66})
67 67
68#define __put_user_size(x, ptr, size, retval) \ 68#define __put_user_size(x, ptr, size, retval, errret) \
69do { \ 69do { \
70 retval = 0; \ 70 retval = 0; \
71 __chk_user_ptr(ptr); \ 71 __chk_user_ptr(ptr); \
72 switch (size) { \ 72 switch (size) { \
73 case 1: \ 73 case 1: \
74 __put_user_asm(x, ptr, retval, "b", "b", "iq", -EFAULT);\ 74 __put_user_asm(x, ptr, retval, "b", "b", "iq", errret);\
75 break; \ 75 break; \
76 case 2: \ 76 case 2: \
77 __put_user_asm(x, ptr, retval, "w", "w", "ir", -EFAULT);\ 77 __put_user_asm(x, ptr, retval, "w", "w", "ir", errret);\
78 break; \ 78 break; \
79 case 4: \ 79 case 4: \
80 __put_user_asm(x, ptr, retval, "l", "k", "ir", -EFAULT);\ 80 __put_user_asm(x, ptr, retval, "l", "k", "ir", errret);\
81 break; \ 81 break; \
82 case 8: \ 82 case 8: \
83 __put_user_asm(x, ptr, retval, "q", "", "Zr", -EFAULT); \ 83 __put_user_asm(x, ptr, retval, "q", "", "Zr", errret); \
84 break; \ 84 break; \
85 default: \ 85 default: \
86 __put_user_bad(); \ 86 __put_user_bad(); \