Commit e68c825b authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Paul Mackerras

[POWERPC] Add inatomic versions of __get_user and __put_user

Those are needed by things like alignment exception fixup handlers
since those can now be triggered by copy_tofrom_user_inatomic.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 06533e28
...@@ -110,12 +110,18 @@ struct exception_table_entry { ...@@ -110,12 +110,18 @@ struct exception_table_entry {
__get_user_nocheck((x), (ptr), sizeof(*(ptr))) __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
#define __put_user(x, ptr) \ #define __put_user(x, ptr) \
__put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr))) __put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
#ifndef __powerpc64__ #ifndef __powerpc64__
#define __get_user64(x, ptr) \ #define __get_user64(x, ptr) \
__get_user64_nocheck((x), (ptr), sizeof(*(ptr))) __get_user64_nocheck((x), (ptr), sizeof(*(ptr)))
#define __put_user64(x, ptr) __put_user(x, ptr) #define __put_user64(x, ptr) __put_user(x, ptr)
#endif #endif
#define __get_user_inatomic(x, ptr) \
__get_user_nosleep((x), (ptr), sizeof(*(ptr)))
#define __put_user_inatomic(x, ptr) \
__put_user_nosleep((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
#define __get_user_unaligned __get_user #define __get_user_unaligned __get_user
#define __put_user_unaligned __put_user #define __put_user_unaligned __put_user
...@@ -198,6 +204,16 @@ do { \ ...@@ -198,6 +204,16 @@ do { \
__pu_err; \ __pu_err; \
}) })
#define __put_user_nosleep(x, ptr, size) \
({ \
long __pu_err; \
__typeof__(*(ptr)) __user *__pu_addr = (ptr); \
__chk_user_ptr(ptr); \
__put_user_size((x), __pu_addr, (size), __pu_err); \
__pu_err; \
})
extern long __get_user_bad(void); extern long __get_user_bad(void);
#define __get_user_asm(x, addr, err, op) \ #define __get_user_asm(x, addr, err, op) \
...@@ -297,6 +313,18 @@ do { \ ...@@ -297,6 +313,18 @@ do { \
__gu_err; \ __gu_err; \
}) })
#define __get_user_nosleep(x, ptr, size) \
({ \
long __gu_err; \
unsigned long __gu_val; \
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
__chk_user_ptr(ptr); \
__get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
(x) = (__typeof__(*(ptr)))__gu_val; \
__gu_err; \
})
/* more complex routines */ /* more complex routines */
extern unsigned long __copy_tofrom_user(void __user *to, extern unsigned long __copy_tofrom_user(void __user *to,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment