Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/vm Add a macro to modify flags in a VM map, which handle...



details:   https://anonhg.NetBSD.org/src/rev/98cc1062113b
branches:  trunk
changeset: 474460:98cc1062113b
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Jul 07 05:33:33 1999 +0000

description:
Add a macro to modify flags in a VM map, which handles the locking
for you.

diffstat:

 sys/vm/vm_map.h |  11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r 7b07c26d8f95 -r 98cc1062113b sys/vm/vm_map.h
--- a/sys/vm/vm_map.h   Wed Jul 07 05:32:26 1999 +0000
+++ b/sys/vm/vm_map.h   Wed Jul 07 05:33:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_map.h,v 1.33 1999/07/01 20:07:05 thorpej Exp $      */
+/*     $NetBSD: vm_map.h,v 1.34 1999/07/07 05:33:33 thorpej Exp $      */
 
 /* 
  * Copyright (c) 1991, 1993
@@ -200,6 +200,15 @@
 #define        VM_MAP_BUSY             0x08            /* rw: map is busy */
 #define        VM_MAP_WANTLOCK         0x10            /* rw: want to write-lock */
 
+#ifdef _KERNEL
+#define        vm_map_modflags(map, set, clear)                                \
+do {                                                                   \
+       simple_lock(&(map)->flags_lock);                                \
+       (map)->flags = ((map)->flags | (set)) & ~(clear);               \
+       simple_unlock(&(map)->flags_lock);                              \
+} while (0)
+#endif /* _KERNEL */
+
 /*
  *     Interrupt-safe maps must also be kept on a special list,
  *     to assist uvm_fault() in avoiding locking problems.



Home | Main Index | Thread Index | Old Index