source: build-files/ports-overlay/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c @ 1e102bd

9.2-releasereleng/10.0releng/10.0.1
Last change on this file since 1e102bd was 1e102bd, checked in by Kris Moore <kris@…>, 6 months ago

Add a bunch of modified ports for 10.0, so we can fix the building

  • Property mode set to 100644
File size: 2.2 KB
Line 
1From Alan L. Cox on FreeBSD-current:
2
3    I just glanced at the virtualbox code for a couple minutes.  For
4    FreeBSD 9 and 10, these lock acquires are completely unnecessary, and
5    have been since FreeBSD 9.0.  Just delete them.  They may be equally
6    unnecessary under FreeBSD 8, but I didn't look carefully enough to
7    answer that question.
8
9[1] http://lists.freebsd.org/pipermail/freebsd-current/2012-November/037963.html
10---
11 src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c | 9 +++++++++
12 1 file changed, 9 insertions(+)
13
14diff --git a/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
15index 5c90cf3..1176b51 100644
16--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
17+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
18@@ -164,14 +164,19 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
19         {
20             VM_OBJECT_LOCK(pMemFreeBSD->pObject);
21             vm_page_t pPage = vm_page_find_least(pMemFreeBSD->pObject, 0);
22+#if __FreeBSD_version < 900000
23+            /* See http://lists.freebsd.org/pipermail/freebsd-current/2012-November/037963.html */
24             vm_page_lock_queues();
25+#endif
26             for (vm_page_t pPage = vm_page_find_least(pMemFreeBSD->pObject, 0);
27                  pPage != NULL;
28                  pPage = vm_page_next(pPage))
29             {
30                 vm_page_unwire(pPage, 0);
31             }
32+#if __FreeBSD_version < 900000
33             vm_page_unlock_queues();
34+#endif
35             VM_OBJECT_UNLOCK(pMemFreeBSD->pObject);
36             vm_object_deallocate(pMemFreeBSD->pObject);
37             break;
38@@ -263,11 +268,15 @@ static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_t pObject, u_long cPages,
39             while (iPage-- > 0)
40             {
41                 pPage = vm_page_lookup(pObject, iPage);
42+#if __FreeBSD_version < 900000
43                 vm_page_lock_queues();
44+#endif
45                 if (fWire)
46                     vm_page_unwire(pPage, 0);
47                 vm_page_free(pPage);
48+#if __FreeBSD_version < 900000
49                 vm_page_unlock_queues();
50+#endif
51             }
52             VM_OBJECT_UNLOCK(pObject);
53             return rcNoMem;
54-- 
551.7.11.5
56
Note: See TracBrowser for help on using the repository browser.