Skip to content

Commit

Permalink
x86: uaccess: fix compilation error on CONFIG_M386
Browse files Browse the repository at this point in the history
In case of !CONFIG_X86_WP_WORKS_OK, __put_user_size_ex() is not defined.
Add macros for !CONFIG_X86_WP_WORKS_OK case.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Hiroshi Shimamoto authored and Ingo Molnar committed Jan 29, 2009
1 parent 3b4b757 commit 019a136
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions arch/x86/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -525,18 +525,36 @@ struct __large_struct { unsigned long buf[100]; };
*/
#define get_user_try uaccess_try
#define get_user_catch(err) uaccess_catch(err)
#define put_user_try uaccess_try
#define put_user_catch(err) uaccess_catch(err)

#define get_user_ex(x, ptr) do { \
unsigned long __gue_val; \
__get_user_size_ex((__gue_val), (ptr), (sizeof(*(ptr)))); \
(x) = (__force __typeof__(*(ptr)))__gue_val; \
} while (0)

#ifdef CONFIG_X86_WP_WORKS_OK

#define put_user_try uaccess_try
#define put_user_catch(err) uaccess_catch(err)

#define put_user_ex(x, ptr) \
__put_user_size_ex((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))

#else /* !CONFIG_X86_WP_WORKS_OK */

#define put_user_try do { \
int __uaccess_err = 0;

#define put_user_catch(err) \
(err) |= __uaccess_err; \
} while (0)

#define put_user_ex(x, ptr) do { \
__uaccess_err |= __put_user(x, ptr); \
} while (0)

#endif /* CONFIG_X86_WP_WORKS_OK */

/*
* movsl can be slow when source and dest are not both 8-byte aligned
*/
Expand Down

0 comments on commit 019a136

Please sign in to comment.