Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/aarch64 Make even more pmap agnostic



details:   https://anonhg.NetBSD.org/src/rev/1501e5af161f
branches:  trunk
changeset: 379213:1501e5af161f
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed May 19 12:16:01 2021 +0000

description:
Make even more pmap agnostic

diffstat:

 sys/arch/aarch64/aarch64/db_interface.c |  25 +++++++++++--------------
 sys/arch/aarch64/include/pmap.h         |   7 ++++++-
 2 files changed, 17 insertions(+), 15 deletions(-)

diffs (85 lines):

diff -r 1f1e4b093820 -r 1501e5af161f sys/arch/aarch64/aarch64/db_interface.c
--- a/sys/arch/aarch64/aarch64/db_interface.c   Wed May 19 11:54:17 2021 +0000
+++ b/sys/arch/aarch64/aarch64/db_interface.c   Wed May 19 12:16:01 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.15 2021/05/19 11:54:17 skrll Exp $ */
+/* $NetBSD: db_interface.c,v 1.16 2021/05/19 12:16:01 skrll Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.15 2021/05/19 11:54:17 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.16 2021/05/19 12:16:01 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -411,14 +411,14 @@ db_pte_print(pt_entry_t pte, int level,
                        break;
                }
 
-               if (pte & LX_BLKPAG_OS_BOOT)
-                       pr(", boot");
-               if (pte & LX_BLKPAG_OS_READ)
-                       pr(", pmap_read");
-               if (pte & LX_BLKPAG_OS_WRITE)
-                       pr(", pmap_write");
-               if (pte & LX_BLKPAG_OS_WIRED)
-                       pr(", wired");
+               if (pte & LX_BLKPAG_OS_0)
+                       pr(", " PMAP_PTE_OS0);
+               if (pte & LX_BLKPAG_OS_1)
+                       pr(", " PMAP_PTE_OS1);
+               if (pte & LX_BLKPAG_OS_2)
+                       pr(", " PMAP_PTE_OS2);
+               if (pte & LX_BLKPAG_OS_3)
+                       pr(", " PMAP_PTE_OS3);
        } else {
                pr(" **ILLEGAL TYPE**");
        }
@@ -526,7 +526,6 @@ dump_ln_table(bool countmode, pd_entry_t
     vaddr_t va, void (*pr)(const char *, ...) __printflike(1, 2))
 {
        struct vm_page *pg;
-       struct vm_page_md *md;
        pd_entry_t pde;
        paddr_t pa;
        int i, n;
@@ -535,13 +534,11 @@ dump_ln_table(bool countmode, pd_entry_t
 
        pa = AARCH64_KVA_TO_PA((vaddr_t)pdp);
        pg = PHYS_TO_VM_PAGE(pa);
-       md = VM_PAGE_TO_MD(pg);
 
        if (pg == NULL) {
                pr("%sL%d: pa=%lx pg=NULL\n", spc, level, pa);
        } else {
-               pr("%sL%d: pa=%lx pg=%p, wire_count=%d, mdpg_ptep_parent=%p\n",
-                   spc, level, pa, pg, pg->wire_count, md->mdpg_ptep_parent);
+               pr("%sL%d: pa=%lx pg=%p", spc, level, pa, pg);
        }
 
        for (i = n = 0; i < Ln_ENTRIES; i++) {
diff -r 1f1e4b093820 -r 1501e5af161f sys/arch/aarch64/include/pmap.h
--- a/sys/arch/aarch64/include/pmap.h   Wed May 19 11:54:17 2021 +0000
+++ b/sys/arch/aarch64/include/pmap.h   Wed May 19 12:16:01 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.47 2021/04/30 20:07:23 skrll Exp $ */
+/* $NetBSD: pmap.h,v 1.48 2021/05/19 12:16:01 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -130,6 +130,11 @@ struct vm_page_md {
 #define LX_BLKPAG_OS_BOOT              LX_BLKPAG_OS_3
 #define LX_BLKPAG_OS_RWMASK            (LX_BLKPAG_OS_WRITE|LX_BLKPAG_OS_READ)
 
+#define PMAP_PTE_OS0   "read"
+#define PMAP_PTE_OS1   "write"
+#define PMAP_PTE_OS2   "wired"
+#define PMAP_PTE_OS3   "boot"
+
 /* memory attributes are configured MAIR_EL1 in locore */
 #define LX_BLKPAG_ATTR_NORMAL_WB       __SHIFTIN(0, LX_BLKPAG_ATTR_INDX)
 #define LX_BLKPAG_ATTR_NORMAL_NC       __SHIFTIN(1, LX_BLKPAG_ATTR_INDX)



Home | Main Index | Thread Index | Old Index