summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_anon.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/uvm/uvm_anon.c')
-rw-r--r--sys/uvm/uvm_anon.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/sys/uvm/uvm_anon.c b/sys/uvm/uvm_anon.c
index b05abc32642..9cf22f1f21f 100644
--- a/sys/uvm/uvm_anon.c
+++ b/sys/uvm/uvm_anon.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_anon.c,v 1.18 2001/11/28 19:28:14 art Exp $ */
-/* $NetBSD: uvm_anon.c,v 1.17 2001/05/25 04:06:12 chs Exp $ */
+/* $OpenBSD: uvm_anon.c,v 1.19 2001/12/19 08:58:07 art Exp $ */
+/* $NetBSD: uvm_anon.c,v 1.15 2001/02/18 21:19:08 chs Exp $ */
/*
*
@@ -116,7 +116,7 @@ uvm_anon_add(count)
anonblock->anons = anon;
LIST_INSERT_HEAD(&anonblock_list, anonblock, list);
memset(anon, 0, sizeof(*anon) * needed);
-
+
simple_lock(&uvm.afreelock);
uvmexp.nanon += needed;
uvmexp.nfreeanon += needed;
@@ -214,7 +214,7 @@ uvm_anfree(anon)
if (pg) {
/*
- * if the page is owned by a uobject (now locked), then we must
+ * if the page is owned by a uobject (now locked), then we must
* kill the loan on the page rather than free it.
*/
@@ -240,10 +240,10 @@ uvm_anfree(anon)
/* tell them to dump it when done */
pg->flags |= PG_RELEASED;
UVMHIST_LOG(maphist,
- " anon 0x%x, page 0x%x: BUSY (released!)",
+ " anon 0x%x, page 0x%x: BUSY (released!)",
anon, pg, 0, 0);
return;
- }
+ }
pmap_page_protect(pg, VM_PROT_NONE);
uvm_lock_pageq(); /* lock out pagedaemon */
uvm_pagefree(pg); /* bye bye */
@@ -272,7 +272,7 @@ uvm_anfree(anon)
/*
* uvm_anon_dropswap: release any swap resources from this anon.
- *
+ *
* => anon must be locked or have a reference count of 0.
*/
void
@@ -294,7 +294,7 @@ uvm_anon_dropswap(anon)
simple_lock(&uvm.swap_data_lock);
uvmexp.swpgonly--;
simple_unlock(&uvm.swap_data_lock);
- }
+ }
}
/*
@@ -398,7 +398,7 @@ uvm_anon_lockloanpg(anon)
/*
* page in every anon that is paged out to a range of swslots.
- *
+ *
* swap_syscall_lock should be held (protects anonblock_list).
*/
@@ -482,20 +482,20 @@ anon_pagein(anon)
rv = uvmfault_anonget(NULL, NULL, anon);
/*
- * if rv == 0, anon is still locked, else anon
+ * if rv == VM_PAGER_OK, anon is still locked, else anon
* is unlocked
*/
switch (rv) {
- case 0:
+ case VM_PAGER_OK:
break;
- case EIO:
- case ERESTART:
+ case VM_PAGER_ERROR:
+ case VM_PAGER_REFAULT:
/*
* nothing more to do on errors.
- * ERESTART can only mean that the anon was freed,
+ * VM_PAGER_REFAULT can only mean that the anon was freed,
* so again there's nothing to do.
*/
@@ -518,6 +518,9 @@ anon_pagein(anon)
*/
pmap_clear_reference(pg);
+#ifndef UBC
+ pmap_page_protect(pg, VM_PROT_NONE);
+#endif
uvm_lock_pageq();
uvm_pagedeactivate(pg);
uvm_unlock_pageq();