Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-2]: src/sys/uvm Pull up revision 1.176 (via patch, requested by y...
details: https://anonhg.NetBSD.org/src/rev/a55c7799a13a
branches: netbsd-2
changeset: 563337:a55c7799a13a
user: he <he%NetBSD.org@localhost>
date: Wed Apr 06 15:23:22 2005 +0000
description:
Pull up revision 1.176 (via patch, requested by yamt in ticket #1061):
Don't merge incompatible map entries, e.g. private and shared.
diffstat:
sys/uvm/uvm_map.c | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)
diffs (103 lines):
diff -r cd6998fc9b50 -r a55c7799a13a sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Wed Apr 06 15:19:10 2005 +0000
+++ b/sys/uvm/uvm_map.c Wed Apr 06 15:23:22 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_map.c,v 1.164.2.3 2004/05/09 09:01:32 jdc Exp $ */
+/* $NetBSD: uvm_map.c,v 1.164.2.3.2.1 2005/04/06 15:23:22 he Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.164.2.3 2004/05/09 09:01:32 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.164.2.3.2.1 2005/04/06 15:23:22 he Exp $");
#include "opt_ddb.h"
#include "opt_uvmhist.h"
@@ -735,6 +735,7 @@
vm_inherit_t inherit = UVM_INHERIT(flags);
int advice = UVM_ADVICE(flags);
int error, merged = 0, kmap = (vm_map_pmap(map) == pmap_kernel());
+ int newetype;
UVMHIST_FUNC("uvm_map");
UVMHIST_CALLED(maphist);
@@ -837,6 +838,17 @@
}
}
+ if (uobj)
+ newetype = UVM_ET_OBJ;
+ else
+ newetype = 0;
+
+ if (flags & UVM_FLAG_COPYONW) {
+ newetype |= UVM_ET_COPYONWRITE;
+ if ((flags & UVM_FLAG_OVERLAY) == 0)
+ newetype |= UVM_ET_NEEDSCOPY;
+ }
+
/*
* try and insert in map by extending previous entry, if possible.
* XXX: we don't try and pull back the next entry. might be useful
@@ -846,7 +858,8 @@
if (flags & UVM_FLAG_NOMERGE)
goto nomerge;
- if (prev_entry->end == *startp &&
+ if (prev_entry->etype == newetype &&
+ prev_entry->end == *startp &&
prev_entry != &map->header &&
prev_entry->object.uvm_obj == uobj) {
@@ -857,9 +870,6 @@
(prev_entry->end - prev_entry->start) != uoffset)
goto forwardmerge;
- if (UVM_ET_ISSUBMAP(prev_entry))
- goto forwardmerge;
-
if (prev_entry->protection != prot ||
prev_entry->max_protection != maxprot)
goto forwardmerge;
@@ -923,7 +933,8 @@
}
forwardmerge:
- if (prev_entry->next->start == (*startp + size) &&
+ if (prev_entry->next->etype == newetype &&
+ prev_entry->next->start == (*startp + size) &&
prev_entry->next != &map->header &&
prev_entry->next->object.uvm_obj == uobj) {
@@ -933,9 +944,6 @@
if (uobj && prev_entry->next->offset != uoffset + size)
goto nomerge;
- if (UVM_ET_ISSUBMAP(prev_entry->next))
- goto nomerge;
-
if (prev_entry->next->protection != prot ||
prev_entry->next->max_protection != maxprot)
goto nomerge;
@@ -1103,16 +1111,8 @@
new_entry->object.uvm_obj = uobj;
new_entry->offset = uoffset;
- if (uobj)
- new_entry->etype = UVM_ET_OBJ;
- else
- new_entry->etype = 0;
-
- if (flags & UVM_FLAG_COPYONW) {
- new_entry->etype |= UVM_ET_COPYONWRITE;
- if ((flags & UVM_FLAG_OVERLAY) == 0)
- new_entry->etype |= UVM_ET_NEEDSCOPY;
- }
+ new_entry->etype = newetype;
+
if (flags & UVM_FLAG_NOMERGE) {
new_entry->flags |= UVM_MAP_NOMERGE;
}
Home |
Main Index |
Thread Index |
Old Index