From fa499a197d9b36c30075870674f768fa98cd10e0 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Mon, 21 Dec 2015 22:34:02 +0000 Subject: [PATCH] Fix build on head after vm_pageout_grow_cache() removal. PR: 205452 --- ...ntime-r0drv-freebsd-memobj-r0drv-freebsd.c | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c b/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c index 957a0ccf94b6..d776015b58ff 100644 --- a/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c @@ -7,9 +7,9 @@ From Alan L. Cox on FreeBSD-current: answer that question. [1] http://lists.freebsd.org/pipermail/freebsd-current/2012-November/037963.html ---- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2015-05-13 11:12:38.000000000 -0400 -+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2015-06-10 16:42:33.632228000 -0400 -@@ -168,14 +168,19 @@ +--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2015-11-10 21:23:50 UTC ++++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c +@@ -168,14 +168,19 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR VM_OBJECT_LOCK(pMemFreeBSD->pObject); #endif vm_page_t pPage = vm_page_find_least(pMemFreeBSD->pObject, 0); @@ -29,7 +29,7 @@ From Alan L. Cox on FreeBSD-current: #if __FreeBSD_version >= 1000030 VM_OBJECT_WUNLOCK(pMemFreeBSD->pObject); #else -@@ -201,12 +206,12 @@ +@@ -201,12 +206,12 @@ static vm_page_t rtR0MemObjFreeBSDContig vm_page_t pPages; int cTries = 0; @@ -44,14 +44,17 @@ From Alan L. Cox on FreeBSD-current: { #if __FreeBSD_version >= 1000030 VM_OBJECT_WLOCK(pObject); -@@ -220,18 +225,20 @@ +@@ -220,18 +225,23 @@ static vm_page_t rtR0MemObjFreeBSDContig #else VM_OBJECT_UNLOCK(pObject); #endif - if (pPages) + if (pPages || cTries >= 1) break; -+#if __FreeBSD_version >= 1000015 ++#if __FreeBSD_version >= 1100092 ++ if (!vm_page_reclaim_contig(fFlags, cPages, 0, VmPhysAddrHigh, uAlignment, 0)) ++ break; ++#elif __FreeBSD_version >= 1000015 vm_pageout_grow_cache(cTries, 0, VmPhysAddrHigh); +#else + vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh); @@ -70,7 +73,7 @@ From Alan L. Cox on FreeBSD-current: break; vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh); cTries++; -@@ -239,11 +246,8 @@ +@@ -239,11 +249,8 @@ static vm_page_t rtR0MemObjFreeBSDContig if (!pPages) return pPages; @@ -83,7 +86,7 @@ From Alan L. Cox on FreeBSD-current: for (vm_pindex_t iPage = 0; iPage < cPages; iPage++) { vm_page_t pPage = pPages + iPage; -@@ -255,13 +259,9 @@ +@@ -255,13 +262,9 @@ static vm_page_t rtR0MemObjFreeBSDContig atomic_add_int(&cnt.v_wire_count, 1); } } @@ -97,7 +100,7 @@ From Alan L. Cox on FreeBSD-current: } static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_t pObject, u_long cPages, -@@ -291,11 +291,15 @@ +@@ -291,11 +294,15 @@ static int rtR0MemObjFreeBSDPhysAllocHel while (iPage-- > 0) { pPage = vm_page_lookup(pObject, iPage); @@ -113,7 +116,7 @@ From Alan L. Cox on FreeBSD-current: } #if __FreeBSD_version >= 1000030 VM_OBJECT_WUNLOCK(pObject); -@@ -743,7 +747,12 @@ +@@ -743,7 +750,12 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser( { /** @todo: is this needed?. */ PROC_LOCK(pProc);