Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Define and use VM_PAGEMD_PVLIST_EMPTY_P



details:   https://anonhg.NetBSD.org/src/rev/d1df503dfa4a
branches:  trunk
changeset: 460379:d1df503dfa4a
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Oct 20 08:29:38 2019 +0000

description:
Define and use VM_PAGEMD_PVLIST_EMPTY_P

diffstat:

 sys/arch/mips/mips/pmap_machdep.c |  6 +++---
 sys/uvm/pmap/pmap.c               |  6 +++---
 sys/uvm/pmap/vmpagemd.h           |  4 +++-
 3 files changed, 9 insertions(+), 7 deletions(-)

diffs (72 lines):

diff -r b6794e762649 -r d1df503dfa4a sys/arch/mips/mips/pmap_machdep.c
--- a/sys/arch/mips/mips/pmap_machdep.c Sun Oct 20 07:58:21 2019 +0000
+++ b/sys/arch/mips/mips/pmap_machdep.c Sun Oct 20 08:29:38 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_machdep.c,v 1.25 2019/08/15 12:24:08 maxv Exp $   */
+/*     $NetBSD: pmap_machdep.c,v 1.26 2019/10/20 08:29:38 skrll Exp $  */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.25 2019/08/15 12:24:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.26 2019/10/20 08:29:38 skrll Exp $");
 
 /*
  *     Manages physical address maps.
@@ -643,7 +643,7 @@
        const register_t src_va = pmap_md_map_ephemeral_page(src_pg, false,
            VM_PROT_READ, &src_pte);
 
-       KASSERT(VM_PAGE_TO_MD(dst_pg)->mdpg_first.pv_pmap == NULL);
+       KASSERT(VM_PAGEMD_PVLIST_EMPTY_P(VM_PAGE_TO_MD(dst_pg)));
        KASSERT(!VM_PAGEMD_EXECPAGE_P(VM_PAGE_TO_MD(dst_pg)));
        const register_t dst_va = pmap_md_map_ephemeral_page(dst_pg, false,
            VM_PROT_READ|VM_PROT_WRITE, &dst_pte);
diff -r b6794e762649 -r d1df503dfa4a sys/uvm/pmap/pmap.c
--- a/sys/uvm/pmap/pmap.c       Sun Oct 20 07:58:21 2019 +0000
+++ b/sys/uvm/pmap/pmap.c       Sun Oct 20 08:29:38 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.43 2019/10/20 07:18:22 skrll Exp $  */
+/*     $NetBSD: pmap.c,v 1.44 2019/10/20 08:29:38 skrll Exp $  */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.43 2019/10/20 07:18:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.44 2019/10/20 08:29:38 skrll Exp $");
 
 /*
  *     Manages physical address maps.
@@ -1045,7 +1045,7 @@
                if (pg != NULL && pte_modified_p(pte)) {
                        struct vm_page_md * const mdpg = VM_PAGE_TO_MD(pg);
                        if (VM_PAGEMD_EXECPAGE_P(mdpg)) {
-                               KASSERT(mdpg->mdpg_first.pv_pmap != NULL);
+                               KASSERT(!VM_PAGEMD_PVLIST_EMPTY_P(mdpg));
 #ifdef PMAP_VIRTUAL_CACHE_ALIASES
                                if (VM_PAGEMD_CACHED_P(mdpg)) {
 #endif
diff -r b6794e762649 -r d1df503dfa4a sys/uvm/pmap/vmpagemd.h
--- a/sys/uvm/pmap/vmpagemd.h   Sun Oct 20 07:58:21 2019 +0000
+++ b/sys/uvm/pmap/vmpagemd.h   Sun Oct 20 08:29:38 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vmpagemd.h,v 1.14 2019/10/20 07:58:21 skrll Exp $      */
+/*     $NetBSD: vmpagemd.h,v 1.15 2019/10/20 08:29:38 skrll Exp $      */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -107,6 +107,8 @@
 #define        VM_PAGEMD_PVLIST_LOCKED_P(mdpg) pmap_pvlist_locked_p(mdpg)
 #define        VM_PAGEMD_PVLIST_GEN(mdpg)      ((mdpg)->mdpg_attrs >> 16)
 
+#define        VM_PAGEMD_PVLIST_EMPTY_P(mdpg)  ((mdpg)->mdpg_first.pv_pmap == NULL)
+
 #ifdef _KERNEL
 #if defined(MULTIPROCESSOR) || defined(MODULAR)
 kmutex_t *pmap_pvlist_lock_addr(struct vm_page_md *);



Home | Main Index | Thread Index | Old Index