summaryrefslogtreecommitdiffstats
path: root/arch/loongarch/mm/maccess.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 000000000..58173842c
--- /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);
+}