diff options
author | Christoph Hellwig <hch@lst.de> | 2019-04-23 18:38:08 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2019-04-23 21:51:40 +0200 |
commit | bd79f94758c011bdffd8d4afcfb578d169cb5e93 (patch) | |
tree | a6a192d9e83428b5cf234370df06d4e29c593761 /arch/h8300/include/asm | |
parent | arch: mostly remove <asm/segment.h> (diff) | |
download | linux-bd79f94758c011bdffd8d4afcfb578d169cb5e93.tar.xz linux-bd79f94758c011bdffd8d4afcfb578d169cb5e93.zip |
asm-generic: provide entirely generic nommu uaccess
Move the code to implement uaccess using memcpy or direct loads and
stores to asm-generic/uaccess.h and make it selectable kconfig option.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/h8300/include/asm')
-rw-r--r-- | arch/h8300/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/h8300/include/asm/uaccess.h | 55 |
2 files changed, 1 insertions, 55 deletions
diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild index 3e7c8ecf151e..988533f02e4a 100644 --- a/arch/h8300/include/asm/Kbuild +++ b/arch/h8300/include/asm/Kbuild @@ -46,6 +46,7 @@ generic-y += timex.h generic-y += tlbflush.h generic-y += topology.h generic-y += trace_clock.h +generic-y += uaccess.h generic-y += unaligned.h generic-y += vga.h generic-y += word-at-a-time.h diff --git a/arch/h8300/include/asm/uaccess.h b/arch/h8300/include/asm/uaccess.h deleted file mode 100644 index bc8031949d07..000000000000 --- a/arch/h8300/include/asm/uaccess.h +++ /dev/null @@ -1,55 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_UACCESS_H -#define _ASM_UACCESS_H - -#include <linux/string.h> - -static inline __must_check unsigned long -raw_copy_from_user(void *to, const void __user * from, unsigned long n) -{ - if (__builtin_constant_p(n)) { - switch(n) { - case 1: - *(u8 *)to = *(u8 __force *)from; - return 0; - case 2: - *(u16 *)to = *(u16 __force *)from; - return 0; - case 4: - *(u32 *)to = *(u32 __force *)from; - return 0; - } - } - - memcpy(to, (const void __force *)from, n); - return 0; -} - -static inline __must_check unsigned long -raw_copy_to_user(void __user *to, const void *from, unsigned long n) -{ - if (__builtin_constant_p(n)) { - switch(n) { - case 1: - *(u8 __force *)to = *(u8 *)from; - return 0; - case 2: - *(u16 __force *)to = *(u16 *)from; - return 0; - case 4: - *(u32 __force *)to = *(u32 *)from; - return 0; - default: - break; - } - } - - memcpy((void __force *)to, from, n); - return 0; -} -#define INLINE_COPY_FROM_USER -#define INLINE_COPY_TO_USER - -#include <asm-generic/uaccess.h> - -#endif |