Commit 2d2d2554 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Palmer Dabbelt

asm-generic: add nommu implementations of __{get,put}_kernel_nofault

Add native implementations of __{get,put}_kernel_nofault using
{get,put}_unaligned, just like the {get,put}_user implementations.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent 931de11f
......@@ -61,6 +61,22 @@ static inline int __put_user_fn(size_t size, void __user *to, void *from)
}
#define __put_user_fn(sz, u, k) __put_user_fn(sz, u, k)
#define __get_kernel_nofault(dst, src, type, err_label) \
do { \
*((type *)dst) = get_unaligned((type *)(src)); \
if (0) /* make sure the label looks used to the compiler */ \
goto err_label; \
} while (0)
#define __put_kernel_nofault(dst, src, type, err_label) \
do { \
put_unaligned(*((type *)src), (type *)(dst)); \
if (0) /* make sure the label looks used to the compiler */ \
goto err_label; \
} while (0)
#define HAVE_GET_KERNEL_NOFAULT 1
static inline __must_check unsigned long
raw_copy_from_user(void *to, const void __user * from, unsigned long n)
{
......
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