aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/linux/io.h
diff options
context:
space:
mode:
authorVladimir Kondratyev <wulf@FreeBSD.org>2021-12-08 21:12:51 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2022-01-10 19:49:38 +0000
commit98b129783c478616f59b3b9c9576a303f7ed67de (patch)
tree0bb870855e43f2ce8b52464a0742b68e0bfa6414 /sys/compat/linuxkpi/common/include/linux/io.h
parent1456816425c35ab1ded97f9b53f17c87ae4a701f (diff)
downloadsrc-98b129783c478616f59b3b9c9576a303f7ed67de.tar.gz
src-98b129783c478616f59b3b9c9576a303f7ed67de.zip
LinuxKPI: Import MTRR support functions from drm-kmod
They are superseded by PAT and mostly useless nowadays but still can be used on Pentium III/IV era processors. Unlike drm-kmod version, this one ignores MTRR if PAT is available that fixes confusing "Failed to add WC MTRR for [0xXXXX-0xYYYY]: 22; performance may suffer" message often appearing during drm-kmod initialization process. MFC after: 1 week Reviewed by: hselasky, manu Differential Revision: https://reviews.freebsd.org/D33561
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux/io.h')
-rw-r--r--sys/compat/linuxkpi/common/include/linux/io.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h
index e402ebed0665..08e1635b70ac 100644
--- a/sys/compat/linuxkpi/common/include/linux/io.h
+++ b/sys/compat/linuxkpi/common/include/linux/io.h
@@ -482,4 +482,12 @@ memunmap(void *addr)
iounmap(addr);
}
+#define __MTRR_ID_BASE 1
+int lkpi_arch_phys_wc_add(unsigned long, unsigned long);
+void lkpi_arch_phys_wc_del(int);
+#define arch_phys_wc_add(...) lkpi_arch_phys_wc_add(__VA_ARGS__)
+#define arch_phys_wc_del(...) lkpi_arch_phys_wc_del(__VA_ARGS__)
+#define arch_phys_wc_index(x) \
+ (((x) < __MTRR_ID_BASE) ? -1 : ((x) - __MTRR_ID_BASE))
+
#endif /* _LINUX_IO_H_ */