summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-03-21 21:39:37 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-03-21 21:39:37 +0000
commit57bc6cc4323fa81fea8daebe464192763080ded1 (patch)
treeb9aa9f60a7008abd970afa0a9c86fba0d7e443d5 /sys
parentc8c7123fd02a9c573056292408114c9a2bab640f (diff)
Allow for two more pmap-specific bits in vm_page pg_flags. Define
PG_PMAPMASK as all the possible pmap-specific bits (similar to the other PG_fooMASK) to make sure MI code does not need to be updated, the next time more bits are allocated to greedy pmaps. No functional change, soon to be used by the (greedy) mips64 pmap.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mips64/mips64/pmap.c5
-rw-r--r--sys/kern/subr_hibernate.c8
-rw-r--r--sys/uvm/uvm_page.h5
-rw-r--r--sys/uvm/uvm_pmemrange.c8
4 files changed, 12 insertions, 14 deletions
diff --git a/sys/arch/mips64/mips64/pmap.c b/sys/arch/mips64/mips64/pmap.c
index 21ef6dd20ba..715fb082a67 100644
--- a/sys/arch/mips64/mips64/pmap.c
+++ b/sys/arch/mips64/mips64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.69 2014/03/10 21:17:58 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.70 2014/03/21 21:39:35 miod Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -1659,8 +1659,7 @@ pmap_remove_pv(pmap_t pmap, vaddr_t va, paddr_t pa)
} else {
pv->pv_pmap = NULL;
atomic_clearbits_int(&pg->pg_flags,
- (PG_PMAP0 | PG_PMAP1 | PG_PMAP2 | PG_PMAP3) &
- ~PV_PRESERVE);
+ PG_PMAPMASK & ~PV_PRESERVE);
}
stat_count(remove_stats.pvfirst);
} else {
diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c
index 4d0efd949c6..cc59ead8463 100644
--- a/sys/kern/subr_hibernate.c
+++ b/sys/kern/subr_hibernate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_hibernate.c,v 1.85 2014/03/13 03:52:56 dlg Exp $ */
+/* $OpenBSD: subr_hibernate.c,v 1.86 2014/03/21 21:39:36 miod Exp $ */
/*
* Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl>
@@ -407,8 +407,7 @@ found:
while (sz > 0) {
KASSERT(pg->pg_flags & PQ_FREE);
- atomic_clearbits_int(&pg->pg_flags,
- PG_PMAP0|PG_PMAP1|PG_PMAP2|PG_PMAP3);
+ atomic_clearbits_int(&pg->pg_flags, PG_PMAPMASK);
if (pg->pg_flags & PG_ZERO)
uvmexp.zeropages -= sz;
@@ -524,8 +523,7 @@ found:
TAILQ_FOREACH(pg, &pageq, pageq) {
KASSERT(pg->pg_flags & PQ_FREE);
- atomic_clearbits_int(&pg->pg_flags,
- PG_PMAP0|PG_PMAP1|PG_PMAP2|PG_PMAP3);
+ atomic_clearbits_int(&pg->pg_flags, PG_PMAPMASK);
if (pg->pg_flags & PG_ZERO)
uvmexp.zeropages--;
diff --git a/sys/uvm/uvm_page.h b/sys/uvm/uvm_page.h
index 06df8260523..4fe6fdb7ab2 100644
--- a/sys/uvm/uvm_page.h
+++ b/sys/uvm/uvm_page.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_page.h,v 1.52 2014/01/23 22:06:30 miod Exp $ */
+/* $OpenBSD: uvm_page.h,v 1.53 2014/03/21 21:39:36 miod Exp $ */
/* $NetBSD: uvm_page.h,v 1.19 2000/12/28 08:24:55 chs Exp $ */
/*
@@ -173,6 +173,9 @@ struct vm_page {
#define PG_PMAP1 0x02000000 /* Used by some pmaps. */
#define PG_PMAP2 0x04000000 /* Used by some pmaps. */
#define PG_PMAP3 0x08000000 /* Used by some pmaps. */
+#define PG_PMAP4 0x10000000 /* Used by some pmaps. */
+#define PG_PMAP5 0x20000000 /* Used by some pmaps. */
+#define PG_PMAPMASK 0x3f000000
/*
* physical memory layout structure
diff --git a/sys/uvm/uvm_pmemrange.c b/sys/uvm/uvm_pmemrange.c
index 4c20e0fe4ca..94dc842baa5 100644
--- a/sys/uvm/uvm_pmemrange.c
+++ b/sys/uvm/uvm_pmemrange.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_pmemrange.c,v 1.37 2014/02/06 16:40:40 tedu Exp $ */
+/* $OpenBSD: uvm_pmemrange.c,v 1.38 2014/03/21 21:39:36 miod Exp $ */
/*
* Copyright (c) 2009, 2010 Ariane van der Steldt <ariane@stack.nl>
@@ -68,8 +68,7 @@
* this check in pages which are freed.
*/
#define VALID_FLAGS(pg_flags) \
- (((pg_flags) & ~(PQ_FREE|PG_ZERO| \
- PG_PMAP0|PG_PMAP1|PG_PMAP2|PG_PMAP3)) == 0x0)
+ (((pg_flags) & ~(PQ_FREE|PG_ZERO|PG_PMAPMASK)) == 0x0)
/* Tree comparators. */
int uvm_pmemrange_addr_cmp(struct uvm_pmemrange *, struct uvm_pmemrange *);
@@ -1043,8 +1042,7 @@ out:
diag_prev = NULL;
#endif /* DIAGNOSTIC */
TAILQ_FOREACH(found, result, pageq) {
- atomic_clearbits_int(&found->pg_flags,
- PG_PMAP0|PG_PMAP1|PG_PMAP2|PG_PMAP3);
+ atomic_clearbits_int(&found->pg_flags, PG_PMAPMASK);
if (found->pg_flags & PG_ZERO) {
uvmexp.zeropages--;