summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authormts <mts@cvs.openbsd.org>2001-07-17 10:31:09 +0000
committermts <mts@cvs.openbsd.org>2001-07-17 10:31:09 +0000
commit4894bf98023d31e5d20486cf2ffa3717a4ef3a55 (patch)
tree992ac0f5abca8d484806b76c0f63409b6c50db88 /sys/uvm
parent2380f4ace211566ec519c638fa7ddbd3f13a11cd (diff)
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.
Diffstat (limited to 'sys/uvm')
-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;