summaryrefslogtreecommitdiff
path: root/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c')
-rw-r--r--emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c45
1 files changed, 42 insertions, 3 deletions
diff --git a/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c b/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c
index fd376f9b528b..91bacd4eef20 100644
--- a/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c
+++ b/emulators/virtualbox-ose-kmod-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c
@@ -5,9 +5,13 @@ to VPO_UNMANAGED for an additional assert.
Reviewed by: kib
See: http://svnweb.freebsd.org/base?view=revision&revision=224746
---- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2011-04-05 14:34:09.000000000 +0200
-+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2011-08-11 15:06:46.000000000 +0200
-@@ -394,9 +394,13 @@
+--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2011-11-04 07:19:54.000000000 -0400
++++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2011-11-29 18:13:32.000000000 -0500
+@@ -391,12 +391,18 @@
+
+ static void rtR0MemObjFreeBSDPhysPageInit(vm_page_t pPage, vm_pindex_t iPage)
+ {
++#if __FreeBSD_version <= 1000000
pPage->wire_count = 1;
pPage->pindex = iPage;
pPage->act_count = 0;
@@ -20,6 +24,41 @@ See: http://svnweb.freebsd.org/base?view=revision&revision=224746
+#else
+ Assert(pPage->flags & PG_UNMANAGED != 0);
+#endif
++#endif
}
+@@ -408,6 +414,9 @@
+ int rc = VINF_SUCCESS;
+ uint32_t cPages = cb >> PAGE_SHIFT;
+ vm_paddr_t VmPhysAddrHigh;
++#if __FreeBSD_version >= 1000001
++ int pFlags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED;
++#endif
+
+ /* create the object. */
+ PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(RT_OFFSETOF(RTR0MEMOBJFREEBSD, u.Phys.apPages[cPages]),
+@@ -424,7 +433,11 @@
+
+ if (fContiguous)
+ {
++#if __FreeBSD_version >= 1000001
++ vm_page_t pPage = vm_page_alloc_contig(NULL, 0, pFlags, cPages, 0, VmPhysAddrHigh, uAlignment, 0, VM_MEMATTR_DEFAULT);
++#else
+ vm_page_t pPage = vm_phys_alloc_contig(cPages, 0, VmPhysAddrHigh, uAlignment, 0);
++#endif
+
+ if (pPage)
+ for (uint32_t iPage = 0; iPage < cPages; iPage++)
+@@ -440,7 +453,11 @@
+ /* Allocate page by page */
+ for (uint32_t iPage = 0; iPage < cPages; iPage++)
+ {
++#if __FreeBSD_version >= 1000001
++ vm_page_t pPage = vm_page_alloc_contig(NULL, iPage, pFlags, 1, 0, VmPhysAddrHigh, uAlignment, 0, VM_MEMATTR_DEFAULT);
++#else
+ vm_page_t pPage = vm_phys_alloc_contig(1, 0, VmPhysAddrHigh, uAlignment, 0);
++#endif
+
+ if (!pPage)
+ {