summaryrefslogtreecommitdiffstats
path: root/arch/loongarch/mm/maccess.c
diff options
context:
space:
mode:
authorHuacai Chen <chenhuacai@loongson.cn>2022-05-31 18:04:11 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2022-06-03 20:09:28 +0800
commit09cfefb7fa70c3af011b0db0a513fd80b2f18abc (patch)
treefc1a269ecba1f88cabb2e79ee92251612ed6605a /arch/loongarch/mm/maccess.c
parent803b0fc5c3f2baa6e54978cd576407896f789b08 (diff)
downloadlinux-stable-09cfefb7fa70c3af011b0db0a513fd80b2f18abc.tar.gz
linux-stable-09cfefb7fa70c3af011b0db0a513fd80b2f18abc.tar.bz2
linux-stable-09cfefb7fa70c3af011b0db0a513fd80b2f18abc.zip
LoongArch: Add memory management
Add memory management support for LoongArch, including: cache and tlb management, page fault handling and ioremap/mmap support. Reviewed-by: WANG Xuerui <git@xen0n.name> Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/mm/maccess.c')
-rw-r--r--arch/loongarch/mm/maccess.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/loongarch/mm/maccess.c b/arch/loongarch/mm/maccess.c
new file mode 100644
index 000000000000..58173842c6be
--- /dev/null
+++ b/arch/loongarch/mm/maccess.c
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <linux/uaccess.h>
+#include <linux/kernel.h>
+
+bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
+{
+ /* highest bit set means kernel space */
+ return (unsigned long)unsafe_src >> (BITS_PER_LONG - 1);
+}