summaryrefslogtreecommitdiff
path: root/include/asm-generic/io.h
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmerdabbelt@google.com>2020-12-11 23:30:26 +0300
committerPalmer Dabbelt <palmerdabbelt@google.com>2020-12-11 23:30:26 +0300
commit7d95a88f9254b711a3a95106fc73f6a3a9866a40 (patch)
tree9c4551d7f2dce744bbefc359b941fd144f66333d /include/asm-generic/io.h
parent3ae9c3cde51abcb777125cfcf74cc402f4d0a4c7 (diff)
parent6585bd827407f55ee30a782492208bfaf4f52feb (diff)
downloadlinux-7d95a88f9254b711a3a95106fc73f6a3a9866a40.tar.xz
Add and use a generic version of devmem_is_allowed()
As part of adding STRICT_DEVMEM support to the RISC-V port, Zong provided an implementation of devmem_is_allowed() that's exactly the same as the version in a handful of other ports. Rather than duplicate code, I've put a generic version of this in lib/ and used it for the RISC-V port. * palmer/generic-devmem: arm64: Use the generic devmem_is_allowed() arm: Use the generic devmem_is_allowed() RISC-V: Use the new generic devmem_is_allowed() lib: Add a generic version of devmem_is_allowed()
Diffstat (limited to 'include/asm-generic/io.h')
-rw-r--r--include/asm-generic/io.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 9ea83d80eb6f..c6af40ce03be 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -1137,6 +1137,10 @@ static inline void memcpy_toio(volatile void __iomem *addr, const void *buffer,
}
#endif
+#ifndef CONFIG_GENERIC_DEVMEM_IS_ALLOWED
+extern int devmem_is_allowed(unsigned long pfn);
+#endif
+
#endif /* __KERNEL__ */
#endif /* __ASM_GENERIC_IO_H */