riscv: use memcpy based uaccess for nommu again
This reverts commit adccfb1a80
.
Now that the generic uaccess by mempcy code handles unaligned addresses
the generic code can be used for all RISC-V CPUs.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
Родитель
3c57fa13f6
Коммит
11129e8ed4
|
@ -88,6 +88,7 @@ config RISCV
|
||||||
select SYSCTL_EXCEPTION_TRACE
|
select SYSCTL_EXCEPTION_TRACE
|
||||||
select THREAD_INFO_IN_TASK
|
select THREAD_INFO_IN_TASK
|
||||||
select SET_FS
|
select SET_FS
|
||||||
|
select UACCESS_MEMCPY if !MMU
|
||||||
|
|
||||||
config ARCH_MMAP_RND_BITS_MIN
|
config ARCH_MMAP_RND_BITS_MIN
|
||||||
default 18 if 64BIT
|
default 18 if 64BIT
|
||||||
|
|
|
@ -13,24 +13,6 @@
|
||||||
/*
|
/*
|
||||||
* User space memory access functions
|
* User space memory access functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern unsigned long __must_check __asm_copy_to_user(void __user *to,
|
|
||||||
const void *from, unsigned long n);
|
|
||||||
extern unsigned long __must_check __asm_copy_from_user(void *to,
|
|
||||||
const void __user *from, unsigned long n);
|
|
||||||
|
|
||||||
static inline unsigned long
|
|
||||||
raw_copy_from_user(void *to, const void __user *from, unsigned long n)
|
|
||||||
{
|
|
||||||
return __asm_copy_from_user(to, from, n);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline unsigned long
|
|
||||||
raw_copy_to_user(void __user *to, const void *from, unsigned long n)
|
|
||||||
{
|
|
||||||
return __asm_copy_to_user(to, from, n);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_MMU
|
#ifdef CONFIG_MMU
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
#include <linux/compiler.h>
|
#include <linux/compiler.h>
|
||||||
|
@ -385,6 +367,24 @@ do { \
|
||||||
-EFAULT; \
|
-EFAULT; \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
unsigned long __must_check __asm_copy_to_user(void __user *to,
|
||||||
|
const void *from, unsigned long n);
|
||||||
|
unsigned long __must_check __asm_copy_from_user(void *to,
|
||||||
|
const void __user *from, unsigned long n);
|
||||||
|
|
||||||
|
static inline unsigned long
|
||||||
|
raw_copy_from_user(void *to, const void __user *from, unsigned long n)
|
||||||
|
{
|
||||||
|
return __asm_copy_from_user(to, from, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline unsigned long
|
||||||
|
raw_copy_to_user(void __user *to, const void *from, unsigned long n)
|
||||||
|
{
|
||||||
|
return __asm_copy_to_user(to, from, n);
|
||||||
|
}
|
||||||
|
|
||||||
extern long strncpy_from_user(char *dest, const char __user *src, long count);
|
extern long strncpy_from_user(char *dest, const char __user *src, long count);
|
||||||
|
|
||||||
extern long __must_check strlen_user(const char __user *str);
|
extern long __must_check strlen_user(const char __user *str);
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
lib-y += delay.o
|
lib-y += delay.o
|
||||||
lib-y += memcpy.o
|
lib-y += memcpy.o
|
||||||
lib-y += memset.o
|
lib-y += memset.o
|
||||||
lib-y += uaccess.o
|
lib-$(CONFIG_MMU) += uaccess.o
|
||||||
lib-$(CONFIG_64BIT) += tishift.o
|
lib-$(CONFIG_64BIT) += tishift.o
|
||||||
|
|
Загрузка…
Ссылка в новой задаче