aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/linux/io.h
diff options
context:
space:
mode:
authorJessica Clarke <jrtc27@FreeBSD.org>2021-10-03 18:34:40 +0000
committerJessica Clarke <jrtc27@FreeBSD.org>2021-10-03 18:34:40 +0000
commit8167c92f65bc20145467b3b98c842cde57736900 (patch)
tree22a7bace86612d501db1678dcc74d0cb126965f3 /sys/compat/linuxkpi/common/include/linux/io.h
parent7047568821a9019359a8518e1f1481f73d6e5445 (diff)
downloadsrc-8167c92f65bc20145467b3b98c842cde57736900.tar.gz
src-8167c92f65bc20145467b3b98c842cde57736900.zip
LinuxKPI: Add more #ifdef VM_MEMATTR_WRITE_COMBINING guards
One of the three uses is already guarded; this guards the remaining ones to support architectures like riscv that do not provide write-combining, and is needed to build drm-kmod on riscv. Reviewed by: hselasky, manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31999
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux/io.h')
-rw-r--r--sys/compat/linuxkpi/common/include/linux/io.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h
index 0104eea90ace..074417b892f9 100644
--- a/sys/compat/linuxkpi/common/include/linux/io.h
+++ b/sys/compat/linuxkpi/common/include/linux/io.h
@@ -411,8 +411,12 @@ void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr);
#define ioremap(addr, size) \
_ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE)
#endif
+#ifdef VM_MEMATTR_WRITE_COMBINING
#define ioremap_wc(addr, size) \
_ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING)
+#else
+#define ioremap_wc(addr, size) ioremap_nocache(addr, size)
+#endif
#define ioremap_wb(addr, size) \
_ioremap_attr((addr), (size), VM_MEMATTR_WRITE_BACK)
void iounmap(void *addr);