diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-09-12 18:54:48 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-09-12 18:54:48 +0000 |
commit | 03a76a3f281b7afa20026d7900942fe09bf75321 (patch) | |
tree | 1619be6580bf3a8e2b5d29c3d8b370d56ec7db34 /sys/uvm | |
parent | 42f0f6e49b2c143e61973ce6a709da978b8554ea (diff) |
Enable some diagnostics for interrupt-safe maps that are already happening for
normal maps.
ok beck@, miod@, guenther@
Diffstat (limited to 'sys/uvm')
-rw-r--r-- | sys/uvm/uvm_map.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index 9c51fa1478c..2ead35caee6 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_map.c,v 1.198 2015/09/09 23:33:37 kettenis Exp $ */ +/* $OpenBSD: uvm_map.c,v 1.199 2015/09/12 18:54:47 kettenis Exp $ */ /* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */ /* @@ -317,6 +317,8 @@ vaddr_t uvm_maxkaddr; do { \ if (((_map)->flags & VM_MAP_INTRSAFE) == 0) \ rw_assert_wrlock(&(_map)->lock); \ + else \ + MUTEX_ASSERT_LOCKED(&(_map)->mtx); \ } while (0) /* @@ -2409,11 +2411,14 @@ uvm_map_setup(struct vm_map *map, vaddr_t min, vaddr_t max, int flags) if ((map->flags & VM_MAP_INTRSAFE) == 0) { if (rw_enter(&map->lock, RW_NOSLEEP|RW_WRITE) != 0) panic("uvm_map_setup: rw_enter failed on new map"); - } + } else + mtx_enter(&map->mtx); uvm_map_setup_entries(map); uvm_tree_sanity(map, __FILE__, __LINE__); if ((map->flags & VM_MAP_INTRSAFE) == 0) rw_exit(&map->lock); + else + mtx_leave(&map->mtx); } /* |