Page MenuHomeFreeBSD

D45058.id138015.diff
No OneTemporary

D45058.id138015.diff

diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h
--- a/sys/compat/linuxkpi/common/include/linux/io.h
+++ b/sys/compat/linuxkpi/common/include/linux/io.h
@@ -32,7 +32,8 @@
#include <sys/endian.h>
#include <sys/types.h>
-#include <machine/vm.h>
+#include <vm/vm.h>
+#include <vm/vm_phys.h>
#include <linux/compiler.h>
#include <linux/err.h>
@@ -541,30 +542,23 @@
#define arch_phys_wc_index(x) \
(((x) < __MTRR_ID_BASE) ? -1 : ((x) - __MTRR_ID_BASE))
-#if defined(__amd64__) || defined(__i386__) || defined(__aarch64__) || defined(__powerpc__) || defined(__riscv)
static inline int
arch_io_reserve_memtype_wc(resource_size_t start, resource_size_t size)
{
- vm_offset_t va;
-
- va = PHYS_TO_DMAP(start);
-
-#ifdef VM_MEMATTR_WRITE_COMBINING
- return (-pmap_change_attr(va, size, VM_MEMATTR_WRITE_COMBINING));
+#if defined(__amd64__) || defined(__i386__)
+ return (-vm_phys_fictitious_reg_range(start, start + size,
+ VM_MEMATTR_WRITE_COMBINING));
#else
- return (-pmap_change_attr(va, size, VM_MEMATTR_UNCACHEABLE));
+ return (0);
#endif
}
static inline void
arch_io_free_memtype_wc(resource_size_t start, resource_size_t size)
{
- vm_offset_t va;
-
- va = PHYS_TO_DMAP(start);
-
- pmap_change_attr(va, size, VM_MEMATTR_WRITE_BACK);
-}
+#if defined(__amd64__) || defined(__i386__)
+ vm_phys_fictitious_unreg_range(start, start + size);
#endif
+}
#endif /* _LINUXKPI_LINUX_IO_H_ */
diff --git a/sys/sys/param.h b/sys/sys/param.h
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -73,7 +73,7 @@
* cannot include sys/param.h and should only be updated here.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 1500018
+#define __FreeBSD_version 1500019
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
diff --git a/sys/vm/_vm_phys.h b/sys/vm/_vm_phys.h
--- a/sys/vm/_vm_phys.h
+++ b/sys/vm/_vm_phys.h
@@ -34,6 +34,8 @@
#ifndef __VM_PHYS_H_
#define __VM_PHYS_H_
+#include <sys/queue.h>
+
#include <machine/vmparam.h>
#ifndef VM_NFREEORDER_MAX
diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h
--- a/sys/vm/vm_phys.h
+++ b/sys/vm/vm_phys.h
@@ -40,6 +40,8 @@
#ifdef _KERNEL
+#include <sys/param.h> /* For NULL */
+
#include <vm/_vm_phys.h>
extern vm_paddr_t phys_avail[];

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 21, 8:24 PM (6 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31931334
Default Alt Text
D45058.id138015.diff (2 KB)

Event Timeline