summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_map.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/uvm/uvm_map.h')
-rw-r--r--sys/uvm/uvm_map.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/uvm/uvm_map.h b/sys/uvm/uvm_map.h
index 70c23e8c56b..df132b17459 100644
--- a/sys/uvm/uvm_map.h
+++ b/sys/uvm/uvm_map.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.h,v 1.52 2014/12/05 04:12:48 uebayasi Exp $ */
+/* $OpenBSD: uvm_map.h,v 1.53 2015/02/06 09:04:34 tedu Exp $ */
/* $NetBSD: uvm_map.h,v 1.24 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -80,6 +80,7 @@
#ifndef _UVM_UVM_MAP_H_
#define _UVM_UVM_MAP_H_
+#include <sys/mutex.h>
#include <sys/rwlock.h>
#ifdef _KERNEL
@@ -293,6 +294,7 @@ struct vm_map {
vsize_t size; /* virtual size */
int ref_count; /* Reference count */
int flags; /* flags */
+ struct mutex flags_lock; /* flags lock */
unsigned int timestamp; /* Version number */
vaddr_t min_offset; /* First address in map. */
@@ -348,7 +350,9 @@ struct vm_map {
#ifdef _KERNEL
#define vm_map_modflags(map, set, clear) \
do { \
+ mtx_enter(&(map)->flags_lock); \
(map)->flags = ((map)->flags | (set)) & ~(clear); \
+ mtx_leave(&(map)->flags_lock); \
} while (0)
#endif /* _KERNEL */