source: build-files/ports-overlay/emulators/open-vm-tools/files/patch-vmmemctl-os.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: 1.2 KB
Line 
1--- modules/freebsd/vmmemctl/os.c.orig  2011-09-21 14:25:15.000000000 -0400
2+++ modules/freebsd/vmmemctl/os.c       2012-06-20 09:44:40.434083000 -0400
3@@ -344,12 +344,22 @@
4    os_state *state = &global_state;
5    os_pmap *pmap = &state->pmap;
6 
7-   if ( !vm_page_lookup(state->vmobject, page->pindex) ) {
8-      return;
9+   VM_OBJECT_LOCK(state->vmobject);
10+   if ( vm_page_lookup(state->vmobject, page->pindex) ) {
11+       os_pmap_putindex(pmap, page->pindex);
12+#if __FreeBSD_version >= 900000
13+       vm_page_lock(page);
14+#else
15+       vm_page_lock_queues();
16+#endif
17+       vm_page_free(page);
18+#if __FreeBSD_version >= 900000
19+       vm_page_unlock(page);
20+#else
21+       vm_page_unlock_queues();
22+#endif
23    }
24-
25-   os_pmap_putindex(pmap, page->pindex);
26-   vm_page_free(page);
27+   VM_OBJECT_UNLOCK(state->vmobject);
28 }
29 
30 
31@@ -361,8 +371,11 @@
32    os_state *state = &global_state;
33    os_pmap *pmap = &state->pmap;
34 
35+   VM_OBJECT_LOCK(state->vmobject);
36+
37    pindex = os_pmap_getindex(pmap);
38    if (pindex == (vm_pindex_t)-1) {
39+      VM_OBJECT_UNLOCK(state->vmobject);
40       return NULL;
41    }
42 
43@@ -383,6 +396,7 @@
44    if (!page) {
45       os_pmap_putindex(pmap, pindex);
46    }
47+   VM_OBJECT_UNLOCK(state->vmobject);
48 
49    return page;
50 }
Note: See TracBrowser for help on using the repository browser.