summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/uvm/uvm.h11
-rw-r--r--sys/uvm/uvm_amap.c5
-rw-r--r--sys/uvm/uvm_anon.c5
-rw-r--r--sys/uvm/uvm_aobj.c5
-rw-r--r--sys/uvm/uvm_device.c90
-rw-r--r--sys/uvm/uvm_fault.c4
-rw-r--r--sys/uvm/uvm_fault.h12
-rw-r--r--sys/uvm/uvm_fault_i.h10
-rw-r--r--sys/uvm/uvm_glue.c5
-rw-r--r--sys/uvm/uvm_init.c5
-rw-r--r--sys/uvm/uvm_io.c5
-rw-r--r--sys/uvm/uvm_km.c5
-rw-r--r--sys/uvm/uvm_loan.c5
-rw-r--r--sys/uvm/uvm_map.c5
-rw-r--r--sys/uvm/uvm_mmap.c5
-rw-r--r--sys/uvm/uvm_page.c5
-rw-r--r--sys/uvm/uvm_pager.c5
-rw-r--r--sys/uvm/uvm_pdaemon.c5
-rw-r--r--sys/uvm/uvm_vnode.c5
19 files changed, 89 insertions, 108 deletions
diff --git a/sys/uvm/uvm.h b/sys/uvm/uvm.h
index bb696dfda42..1a61e80df34 100644
--- a/sys/uvm/uvm.h
+++ b/sys/uvm/uvm.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm.h,v 1.12 2001/08/11 10:57:22 art Exp $ */
-/* $NetBSD: uvm.h,v 1.22 2000/06/08 05:52:34 thorpej Exp $ */
+/* $OpenBSD: uvm.h,v 1.13 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm.h,v 1.23 2000/06/26 14:21:16 mrg Exp $ */
/*
*
@@ -130,12 +130,11 @@ struct uvm {
#define UVM_ET_ISCOPYONWRITE(E) (((E)->etype & UVM_ET_COPYONWRITE) != 0)
#define UVM_ET_ISNEEDSCOPY(E) (((E)->etype & UVM_ET_NEEDSCOPY) != 0)
-/*
- * macros
- */
-
#ifdef _KERNEL
+/*
+ * holds all the internal UVM data
+ */
extern struct uvm uvm;
/*
diff --git a/sys/uvm/uvm_amap.c b/sys/uvm/uvm_amap.c
index 1a67c4e1ac8..ea08c4670e2 100644
--- a/sys/uvm/uvm_amap.c
+++ b/sys/uvm/uvm_amap.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_amap.c,v 1.10 2001/09/11 20:05:25 miod Exp $ */
-/* $NetBSD: uvm_amap.c,v 1.22 1999/09/12 01:17:33 chs Exp $ */
+/* $OpenBSD: uvm_amap.c,v 1.11 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_amap.c,v 1.23 2000/06/26 14:21:16 mrg Exp $ */
/*
*
@@ -51,7 +51,6 @@
#include <sys/pool.h>
#include <vm/vm.h>
-#include <vm/vm_page.h>
#define UVM_AMAP_C /* ensure disabled inlines are in */
#include <uvm/uvm.h>
diff --git a/sys/uvm/uvm_anon.c b/sys/uvm/uvm_anon.c
index e908837eab0..170368c6212 100644
--- a/sys/uvm/uvm_anon.c
+++ b/sys/uvm/uvm_anon.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_anon.c,v 1.10 2001/09/19 20:50:59 mickey Exp $ */
-/* $NetBSD: uvm_anon.c,v 1.5 2000/01/11 06:57:49 chs Exp $ */
+/* $OpenBSD: uvm_anon.c,v 1.11 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_anon.c,v 1.6 2000/06/26 14:21:16 mrg Exp $ */
/*
*
@@ -45,7 +45,6 @@
#include <sys/kernel.h>
#include <vm/vm.h>
-#include <vm/vm_page.h>
#include <uvm/uvm.h>
#include <uvm/uvm_swap.h>
diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c
index 97d1c77c4b9..7aa9589ca0b 100644
--- a/sys/uvm/uvm_aobj.c
+++ b/sys/uvm/uvm_aobj.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_aobj.c,v 1.15 2001/09/11 20:05:26 miod Exp $ */
-/* $NetBSD: uvm_aobj.c,v 1.31 2000/05/19 04:34:45 thorpej Exp $ */
+/* $OpenBSD: uvm_aobj.c,v 1.16 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_aobj.c,v 1.32 2000/06/26 14:21:17 mrg Exp $ */
/*
* Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and
@@ -51,7 +51,6 @@
#include <sys/kernel.h>
#include <vm/vm.h>
-#include <vm/vm_page.h>
#include <uvm/uvm.h>
diff --git a/sys/uvm/uvm_device.c b/sys/uvm/uvm_device.c
index b61ff7d7157..0c93389c59d 100644
--- a/sys/uvm/uvm_device.c
+++ b/sys/uvm/uvm_device.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_device.c,v 1.14 2001/11/01 14:31:25 art Exp $ */
-/* $NetBSD: uvm_device.c,v 1.22 2000/05/28 10:21:55 drochner Exp $ */
+/* $OpenBSD: uvm_device.c,v 1.15 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_device.c,v 1.26 2000/06/26 14:21:17 mrg Exp $ */
/*
*
@@ -47,7 +47,6 @@
#include <sys/vnode.h>
#include <vm/vm.h>
-#include <vm/vm_page.h>
#include <uvm/uvm.h>
#include <uvm/uvm_device.h>
@@ -145,12 +144,15 @@ udv_attach(arg, accessprot, off, size)
mapfn = cdevsw[major(device)].d_mmap;
if (mapfn == NULL ||
- mapfn == (paddr_t (*) __P((dev_t, off_t, int)))enodev ||
- mapfn == (paddr_t (*) __P((dev_t, off_t, int)))nullop)
+ mapfn == (paddr_t (*) __P((dev_t, off_t, int))) enodev ||
+ mapfn == (paddr_t (*) __P((dev_t, off_t, int))) nullop)
return(NULL);
+ /*
+ * Negative offsets on the object are not allowed.
+ */
if (off < 0)
- return (NULL);
+ return(NULL);
/*
* Check that the specified range of the device allows the
@@ -310,56 +312,50 @@ udv_detach(uobj)
struct uvm_device *udv = (struct uvm_device *) uobj;
UVMHIST_FUNC("udv_detach"); UVMHIST_CALLED(maphist);
+
/*
* loop until done
*/
-
- while (1) {
- simple_lock(&uobj->vmobjlock);
-
- if (uobj->uo_refs > 1) {
- uobj->uo_refs--; /* drop ref! */
- simple_unlock(&uobj->vmobjlock);
- UVMHIST_LOG(maphist," <- done, uobj=0x%x, ref=%d",
- uobj,uobj->uo_refs,0,0);
- return;
- }
+again:
+ simple_lock(&uobj->vmobjlock);
+
+ if (uobj->uo_refs > 1) {
+ uobj->uo_refs--; /* drop ref! */
+ simple_unlock(&uobj->vmobjlock);
+ UVMHIST_LOG(maphist," <- done, uobj=0x%x, ref=%d",
+ uobj,uobj->uo_refs,0,0);
+ return;
+ }
#ifdef DIAGNOSTIC
- if (uobj->uo_npages || uobj->memq.tqh_first)
- panic("udv_detach: pages in a device object?");
+ if (uobj->uo_npages || !TAILQ_EMPTY(&uobj->memq))
+ panic("udv_detach: pages in a device object?");
#endif
- /*
- * now lock udv_lock
- */
- simple_lock(&udv_lock);
-
- /*
- * is it being held? if so, wait until others are done.
- */
- if (udv->u_flags & UVM_DEVICE_HOLD) {
-
- /*
- * want it
- */
- udv->u_flags |= UVM_DEVICE_WANTED;
- simple_unlock(&uobj->vmobjlock);
- UVM_UNLOCK_AND_WAIT(udv, &udv_lock, FALSE, "udv_detach",0);
- continue;
- }
-
- /*
- * got it! nuke it now.
- */
+ /*
+ * now lock udv_lock
+ */
+ simple_lock(&udv_lock);
- LIST_REMOVE(udv, u_list);
- if (udv->u_flags & UVM_DEVICE_WANTED)
- wakeup(udv);
- FREE(udv, M_TEMP);
- break; /* DONE! */
+ /*
+ * is it being held? if so, wait until others are done.
+ */
+ if (udv->u_flags & UVM_DEVICE_HOLD) {
+ udv->u_flags |= UVM_DEVICE_WANTED;
+ simple_unlock(&uobj->vmobjlock);
+ UVM_UNLOCK_AND_WAIT(udv, &udv_lock, FALSE, "udv_detach",0);
+ goto again;
+ }
- } /* while (1) loop */
+ /*
+ * got it! nuke it now.
+ */
+ LIST_REMOVE(udv, u_list);
+ if (udv->u_flags & UVM_DEVICE_WANTED)
+ wakeup(udv);
+ simple_unlock(&udv_lock);
+ simple_unlock(&uobj->vmobjlock);
+ FREE(udv, M_TEMP);
UVMHIST_LOG(maphist," <- done, freed uobj=0x%x", uobj,0,0,0);
return;
diff --git a/sys/uvm/uvm_fault.c b/sys/uvm/uvm_fault.c
index ba194035fd3..b1304ced2f8 100644
--- a/sys/uvm/uvm_fault.c
+++ b/sys/uvm/uvm_fault.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_fault.c,v 1.19 2001/09/19 20:50:59 mickey Exp $ */
-/* $NetBSD: uvm_fault.c,v 1.48 2000/04/10 01:17:41 thorpej Exp $ */
+/* $OpenBSD: uvm_fault.c,v 1.20 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_fault.c,v 1.49 2000/06/26 14:21:17 mrg Exp $ */
/*
*
diff --git a/sys/uvm/uvm_fault.h b/sys/uvm/uvm_fault.h
index f7e87d40fa3..0abb41d7e46 100644
--- a/sys/uvm/uvm_fault.h
+++ b/sys/uvm/uvm_fault.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_fault.h,v 1.8 2001/05/09 15:58:29 art Exp $ */
-/* $NetBSD: uvm_fault.h,v 1.13 1999/06/21 17:25:11 thorpej Exp $ */
+/* $OpenBSD: uvm_fault.h,v 1.9 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_fault.h,v 1.14 2000/06/26 14:21:17 mrg Exp $ */
/*
*
@@ -74,13 +74,7 @@ struct uvm_faultinfo {
int uvmfault_anonget __P((struct uvm_faultinfo *, struct vm_amap *,
- struct vm_anon *));
-static boolean_t uvmfault_check_intrsafe __P((struct uvm_faultinfo *));
-static boolean_t uvmfault_lookup __P((struct uvm_faultinfo *, boolean_t));
-static boolean_t uvmfault_relock __P((struct uvm_faultinfo *));
-static void uvmfault_unlockall __P((struct uvm_faultinfo *, struct vm_amap *,
- struct uvm_object *, struct vm_anon *));
-static void uvmfault_unlockmaps __P((struct uvm_faultinfo *, boolean_t));
+ struct vm_anon *));
int uvm_fault_wire __P((vm_map_t, vaddr_t, vaddr_t, vm_prot_t));
void uvm_fault_unwire __P((vm_map_t, vaddr_t, vaddr_t));
diff --git a/sys/uvm/uvm_fault_i.h b/sys/uvm/uvm_fault_i.h
index d5b53c87713..66f98503340 100644
--- a/sys/uvm/uvm_fault_i.h
+++ b/sys/uvm/uvm_fault_i.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_fault_i.h,v 1.6 2001/07/26 19:37:13 art Exp $ */
-/* $NetBSD: uvm_fault_i.h,v 1.10 2000/01/11 06:57:50 chs Exp $ */
+/* $OpenBSD: uvm_fault_i.h,v 1.7 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_fault_i.h,v 1.11 2000/06/26 14:21:17 mrg Exp $ */
/*
*
@@ -41,6 +41,12 @@
/*
* uvm_fault_i.h: fault inline functions
*/
+static boolean_t uvmfault_check_intrsafe __P((struct uvm_faultinfo *));
+static boolean_t uvmfault_lookup __P((struct uvm_faultinfo *, boolean_t));
+static boolean_t uvmfault_relock __P((struct uvm_faultinfo *));
+static void uvmfault_unlockall __P((struct uvm_faultinfo *, struct vm_amap *,
+ struct uvm_object *, struct vm_anon *));
+static void uvmfault_unlockmaps __P((struct uvm_faultinfo *, boolean_t));
/*
* uvmfault_unlockmaps: unlock the maps
diff --git a/sys/uvm/uvm_glue.c b/sys/uvm/uvm_glue.c
index 21c3f94a42f..970bcec90d2 100644
--- a/sys/uvm/uvm_glue.c
+++ b/sys/uvm/uvm_glue.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_glue.c,v 1.20 2001/09/19 20:50:59 mickey Exp $ */
-/* $NetBSD: uvm_glue.c,v 1.36 2000/06/18 05:20:27 simonb Exp $ */
+/* $OpenBSD: uvm_glue.c,v 1.21 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_glue.c,v 1.37 2000/06/26 14:21:17 mrg Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -82,7 +82,6 @@
#endif
#include <vm/vm.h>
-#include <vm/vm_page.h>
#include <uvm/uvm.h>
diff --git a/sys/uvm/uvm_init.c b/sys/uvm/uvm_init.c
index d53d960c178..76810c1e3b9 100644
--- a/sys/uvm/uvm_init.c
+++ b/sys/uvm/uvm_init.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_init.c,v 1.8 2001/09/19 20:50:59 mickey Exp $ */
-/* $NetBSD: uvm_init.c,v 1.12 2000/03/29 03:43:34 simonb Exp $ */
+/* $OpenBSD: uvm_init.c,v 1.9 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_init.c,v 1.13 2000/06/26 14:21:18 mrg Exp $ */
/*
*
@@ -51,7 +51,6 @@
#include <vm/vm.h>
-#include <vm/vm_page.h>
#include <uvm/uvm.h>
diff --git a/sys/uvm/uvm_io.c b/sys/uvm/uvm_io.c
index b7f09e883c0..404d89140cf 100644
--- a/sys/uvm/uvm_io.c
+++ b/sys/uvm/uvm_io.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_io.c,v 1.8 2001/09/20 02:07:43 art Exp $ */
-/* $NetBSD: uvm_io.c,v 1.10 2000/06/02 12:02:44 pk Exp $ */
+/* $OpenBSD: uvm_io.c,v 1.9 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_io.c,v 1.11 2000/06/26 14:21:18 mrg Exp $ */
/*
*
@@ -47,7 +47,6 @@
#include <sys/uio.h>
#include <vm/vm.h>
-#include <vm/vm_page.h>
#include <uvm/uvm.h>
diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c
index c84d2a2dbf2..714f2446967 100644
--- a/sys/uvm/uvm_km.c
+++ b/sys/uvm/uvm_km.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_km.c,v 1.15 2001/09/19 20:50:59 mickey Exp $ */
-/* $NetBSD: uvm_km.c,v 1.35 2000/05/08 23:10:20 thorpej Exp $ */
+/* $OpenBSD: uvm_km.c,v 1.16 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_km.c,v 1.36 2000/06/26 14:21:18 mrg Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -146,7 +146,6 @@
#include <sys/proc.h>
#include <vm/vm.h>
-#include <vm/vm_page.h>
#include <uvm/uvm.h>
diff --git a/sys/uvm/uvm_loan.c b/sys/uvm/uvm_loan.c
index bc68a2b95d6..436a85ad57d 100644
--- a/sys/uvm/uvm_loan.c
+++ b/sys/uvm/uvm_loan.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_loan.c,v 1.9 2001/09/11 20:05:26 miod Exp $ */
-/* $NetBSD: uvm_loan.c,v 1.20 2000/04/10 00:32:46 thorpej Exp $ */
+/* $OpenBSD: uvm_loan.c,v 1.10 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_loan.c,v 1.21 2000/06/26 14:21:18 mrg Exp $ */
/*
*
@@ -47,7 +47,6 @@
#include <sys/mman.h>
#include <vm/vm.h>
-#include <vm/vm_page.h>
#include <uvm/uvm.h>
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index cb58056d052..28487cab6aa 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_map.c,v 1.24 2001/09/19 20:50:59 mickey Exp $ */
-/* $NetBSD: uvm_map.c,v 1.77 2000/06/13 04:10:47 chs Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.25 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_map.c,v 1.78 2000/06/26 14:21:18 mrg Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -83,7 +83,6 @@
#endif
#include <vm/vm.h>
-#include <vm/vm_page.h>
#define UVM_MAP
#include <uvm/uvm.h>
diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c
index 78ccea49e57..19b48f6cbeb 100644
--- a/sys/uvm/uvm_mmap.c
+++ b/sys/uvm/uvm_mmap.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_mmap.c,v 1.21 2001/10/26 12:03:28 art Exp $ */
-/* $NetBSD: uvm_mmap.c,v 1.41 2000/05/23 02:19:20 enami Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.22 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_mmap.c,v 1.42 2000/06/26 14:21:18 mrg Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,6 @@
#include <miscfs/specfs/specdev.h>
#include <vm/vm.h>
-#include <vm/vm_page.h>
#include <sys/syscallargs.h>
diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c
index 9307c0bf008..95d5d35739f 100644
--- a/sys/uvm/uvm_page.c
+++ b/sys/uvm/uvm_page.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_page.c,v 1.24 2001/09/19 20:50:59 mickey Exp $ */
-/* $NetBSD: uvm_page.c,v 1.37 2000/06/09 04:43:19 soda Exp $ */
+/* $OpenBSD: uvm_page.c,v 1.25 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_page.c,v 1.38 2000/06/26 14:21:18 mrg Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -77,7 +77,6 @@
#include <sys/sched.h>
#include <vm/vm.h>
-#include <vm/vm_page.h>
#define UVM_PAGE /* pull in uvm_page.h functions */
#include <uvm/uvm.h>
diff --git a/sys/uvm/uvm_pager.c b/sys/uvm/uvm_pager.c
index f85693b932a..57003313dc7 100644
--- a/sys/uvm/uvm_pager.c
+++ b/sys/uvm/uvm_pager.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_pager.c,v 1.16 2001/09/20 17:02:32 mpech Exp $ */
-/* $NetBSD: uvm_pager.c,v 1.30 2000/05/20 03:36:06 thorpej Exp $ */
+/* $OpenBSD: uvm_pager.c,v 1.17 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_pager.c,v 1.31 2000/06/26 14:21:18 mrg Exp $ */
/*
*
@@ -45,7 +45,6 @@
#include <sys/malloc.h>
#include <vm/vm.h>
-#include <vm/vm_page.h>
#define UVM_PAGER
#include <uvm/uvm.h>
diff --git a/sys/uvm/uvm_pdaemon.c b/sys/uvm/uvm_pdaemon.c
index c4710f333f0..42b0aaa70b1 100644
--- a/sys/uvm/uvm_pdaemon.c
+++ b/sys/uvm/uvm_pdaemon.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_pdaemon.c,v 1.13 2001/09/11 20:05:26 miod Exp $ */
-/* $NetBSD: uvm_pdaemon.c,v 1.19 1999/11/04 21:51:42 thorpej Exp $ */
+/* $OpenBSD: uvm_pdaemon.c,v 1.14 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_pdaemon.c,v 1.20 2000/06/26 14:21:18 mrg Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -78,7 +78,6 @@
#include <sys/pool.h>
#include <vm/vm.h>
-#include <vm/vm_page.h>
#include <uvm/uvm.h>
diff --git a/sys/uvm/uvm_vnode.c b/sys/uvm/uvm_vnode.c
index ba2af86d07d..3bcf1d8ce6c 100644
--- a/sys/uvm/uvm_vnode.c
+++ b/sys/uvm/uvm_vnode.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_vnode.c,v 1.20 2001/09/11 20:05:26 miod Exp $ */
-/* $NetBSD: uvm_vnode.c,v 1.33 2000/05/19 03:45:05 thorpej Exp $ */
+/* $OpenBSD: uvm_vnode.c,v 1.21 2001/11/05 22:14:54 art Exp $ */
+/* $NetBSD: uvm_vnode.c,v 1.34 2000/06/26 14:21:19 mrg Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -63,7 +63,6 @@
#include <miscfs/specfs/specdev.h>
#include <vm/vm.h>
-#include <vm/vm_page.h>
#include <uvm/uvm.h>
#include <uvm/uvm_vnode.h>