summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/uvm/uvm.h4
-rw-r--r--sys/uvm/uvm_extern.h3
-rw-r--r--sys/uvm/uvm_map.c8
3 files changed, 11 insertions, 4 deletions
diff --git a/sys/uvm/uvm.h b/sys/uvm/uvm.h
index 977d45c3b29..3d04e53b9a4 100644
--- a/sys/uvm/uvm.h
+++ b/sys/uvm/uvm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm.h,v 1.23 2008/05/05 15:37:41 thib Exp $ */
+/* $OpenBSD: uvm.h,v 1.24 2008/06/09 20:30:23 miod Exp $ */
/* $NetBSD: uvm.h,v 1.24 2000/11/27 08:40:02 chs Exp $ */
/*
@@ -128,11 +128,13 @@ struct uvm {
#define UVM_ET_SUBMAP 0x02 /* it is a vm_map submap */
#define UVM_ET_COPYONWRITE 0x04 /* copy_on_write */
#define UVM_ET_NEEDSCOPY 0x08 /* needs_copy */
+#define UVM_ET_HOLE 0x10 /* no backend */
#define UVM_ET_ISOBJ(E) (((E)->etype & UVM_ET_OBJ) != 0)
#define UVM_ET_ISSUBMAP(E) (((E)->etype & UVM_ET_SUBMAP) != 0)
#define UVM_ET_ISCOPYONWRITE(E) (((E)->etype & UVM_ET_COPYONWRITE) != 0)
#define UVM_ET_ISNEEDSCOPY(E) (((E)->etype & UVM_ET_NEEDSCOPY) != 0)
+#define UVM_ET_ISHOLE(E) (((E)->etype & UVM_ET_HOLE) != 0)
#ifdef _KERNEL
diff --git a/sys/uvm/uvm_extern.h b/sys/uvm/uvm_extern.h
index 406a2a0391c..f0e48816b5b 100644
--- a/sys/uvm/uvm_extern.h
+++ b/sys/uvm/uvm_extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_extern.h,v 1.69 2008/04/09 16:58:11 deraadt Exp $ */
+/* $OpenBSD: uvm_extern.h,v 1.70 2008/06/09 20:30:23 miod Exp $ */
/* $NetBSD: uvm_extern.h,v 1.57 2001/03/09 01:02:12 chs Exp $ */
/*
@@ -184,6 +184,7 @@ typedef int vm_prot_t;
#define UVM_FLAG_COPYONW 0x080000 /* set copy_on_write flag */
#define UVM_FLAG_AMAPPAD 0x100000 /* for bss: pad amap to reduce malloc() */
#define UVM_FLAG_TRYLOCK 0x200000 /* fail if we can not lock map */
+#define UVM_FLAG_HOLE 0x400000 /* no backend */
/* macros to extract info */
#define UVM_PROTECTION(X) ((X) & UVM_PROT_MASK)
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index bc605570b0d..a13a7ce92a6 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.99 2007/09/15 10:10:37 martin Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.100 2008/06/09 20:30:23 miod Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -897,6 +897,8 @@ step3:
if ((flags & UVM_FLAG_OVERLAY) == 0)
new_entry->etype |= UVM_ET_NEEDSCOPY;
}
+ if (flags & UVM_FLAG_HOLE)
+ new_entry->etype |= UVM_ET_HOLE;
new_entry->protection = prot;
new_entry->max_protection = maxprot;
@@ -1451,7 +1453,9 @@ uvm_unmap_remove(struct vm_map *map, vaddr_t start, vaddr_t end,
* special case: handle mappings to anonymous kernel objects.
* we want to free these pages right away...
*/
- if (map->flags & VM_MAP_INTRSAFE) {
+ if (UVM_ET_ISHOLE(entry)) {
+ /* nothing to do! */
+ } else if (map->flags & VM_MAP_INTRSAFE) {
uvm_km_pgremove_intrsafe(entry->start, entry->end);
pmap_kremove(entry->start, len);
} else if (UVM_ET_ISOBJ(entry) &&