summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormts <mts@openbsd.org>2001-07-17 10:31:08 +0000
committermts <mts@openbsd.org>2001-07-17 10:31:08 +0000
commit15b329e87ee05b48b92702e13f66f814fe47ea28 (patch)
tree629a67d9874da21f3956cb2399dbcdcf79840c2f
parentI2O is supported too (diff)
downloadwireguard-openbsd-15b329e87ee05b48b92702e13f66f814fe47ea28.tar.xz
wireguard-openbsd-15b329e87ee05b48b92702e13f66f814fe47ea28.zip
current netbsd's uvm_map uses a 3-parm SAVE_HINT to perform a test/swap
under locked conditions. we currently use a 2-parm SAVE_HINT... to meet the same functionality, we instead need to validate the hint is the one CURRENTLY in the map before substituing it, and we need to do that while the lock is retained.
-rw-r--r--sys/uvm/uvm_map.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index 7a817b82903..07365816ab7 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.17 2001/07/11 13:57:54 mts Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.18 2001/07/17 10:31:08 mts Exp $ */
/* $NetBSD: uvm_map.c,v 1.68 1999/08/21 02:19:05 thorpej Exp $ */
/*
@@ -1059,7 +1059,11 @@ uvm_unmap_remove(map, start, end, entry_list)
UVMHIST_LOG(maphist, " removed map entry 0x%x", entry, 0, 0,0);
/* critical! prevents stale hint */
- SAVE_HINT(map, entry->prev);
+ /* XXX: need SAVE_HINT with three parms */
+ simple_lock(map->hint_lock);
+ if (map->hint == entry)
+ map->hint = entry->prev;
+ simple_unlock(map->hint_lock);
uvm_map_entry_unlink(map, entry);
map->size -= len;