summaryrefslogtreecommitdiff
path: root/arch/loongarch/include
diff options
context:
space:
mode:
authorHuacai Chen <chenhuacai@loongson.cn>2022-10-12 16:36:14 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2022-10-12 16:36:14 +0800
commit235d074fdc9a69e3720b8bb6efeb7c6d30c12d8e (patch)
tree2ad87b94ebfa30791c7c9cf2ccf4eb41a263ceeb /arch/loongarch/include
parentb61a40afca164a9bd066f749beff3bf209c5e209 (diff)
downloadlwn-235d074fdc9a69e3720b8bb6efeb7c6d30c12d8e.tar.gz
lwn-235d074fdc9a69e3720b8bb6efeb7c6d30c12d8e.zip
LoongArch: Support access filter to /dev/mem interface
Accidental access to /dev/mem is obviously disastrous, but specific access can be used by people debugging the kernel. So select GENERIC_ LIB_DEVMEM_IS_ALLOWED, as well as define ARCH_HAS_VALID_PHYS_ADDR_RANGE and related helpers, to support access filter to /dev/mem interface. Signed-off-by: Weihao Li <liweihao@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/include')
-rw-r--r--arch/loongarch/include/asm/io.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/loongarch/include/asm/io.h b/arch/loongarch/include/asm/io.h
index 999944ea1cea..398d1a7b3dd6 100644
--- a/arch/loongarch/include/asm/io.h
+++ b/arch/loongarch/include/asm/io.h
@@ -107,4 +107,8 @@ extern void __memcpy_fromio(void *to, const volatile void __iomem *from, size_t
#include <asm-generic/io.h>
+#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
+extern int valid_phys_addr_range(phys_addr_t addr, size_t size);
+extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
+
#endif /* _ASM_IO_H */