summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_mmap.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-07-25 13:25:34 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-07-25 13:25:34 +0000
commit9b5d0ac364b4502c9f4962efc3b9cf762eeb8a23 (patch)
treec5b76dbc032ac625cb87376504029b7b8c6c8f71 /sys/uvm/uvm_mmap.c
parent2aa44ff1a290aa08d7d6659ac7350bb6d3efb06c (diff)
Change the pmap_enter interface to merge access_type and the wired boolean
and arbitrary flags into one argument. One new flag is PMAP_CANFAIL that tells pmap_enter that it can fail if there are not enough resources to satisfy the request. If this flag is not passed, pmap_enter should panic as it should have done before this change (XXX - many pmaps are still not doing that). Only i386 and alpha implement CANFAIL for now. Includes uvm updates from NetBSD.
Diffstat (limited to 'sys/uvm/uvm_mmap.c')
-rw-r--r--sys/uvm/uvm_mmap.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c
index d52dfa4e539..33f6ee1a9fb 100644
--- a/sys/uvm/uvm_mmap.c
+++ b/sys/uvm/uvm_mmap.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_mmap.c,v 1.15 2001/06/23 19:24:34 smart Exp $ */
-/* $NetBSD: uvm_mmap.c,v 1.35 1999/07/17 21:35:50 thorpej Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.16 2001/07/25 13:25:33 art Exp $ */
+/* $NetBSD: uvm_mmap.c,v 1.36 1999/11/13 00:24:38 thorpej Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -1154,7 +1154,19 @@ uvm_mmap(map, addr, size, prot, maxprot, flags, handle, foff, locklimit)
*/
if (flags & MAP_ANON) {
+#if 1
+ /*
+ * Specify an offset of 0 so that uvm_map_findspace() via.
+ * uvm_map() will PMAP_PREFER the address for us. This
+ * prevents alias problems if the following occurs:
+ *
+ * - Anon region mapped.
+ * - File mapped over anon region (using MAP_FIXED).
+ */
+ foff = 0;
+#else
foff = UVM_UNKNOWN_OFFSET;
+#endif
uobj = NULL;
if ((flags & MAP_SHARED) == 0)
/* XXX: defer amap create */