Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/aarch64 Only print the appropriate PAR fields for P...



details:   https://anonhg.NetBSD.org/src/rev/e45842a3935e
branches:  trunk
changeset: 365900:e45842a3935e
user:      skrll <skrll%NetBSD.org@localhost>
date:      Mon May 02 10:13:15 2022 +0000

description:
Only print the appropriate PAR fields for PAR.F={0,1}

Group the fields in the header.

diffstat:

 sys/arch/aarch64/aarch64/db_machdep.c |  38 +++++++++++++++++++++++-----------
 sys/arch/aarch64/include/armreg.h     |  11 +++++----
 2 files changed, 31 insertions(+), 18 deletions(-)

diffs (85 lines):

diff -r b64eb3b5937b -r e45842a3935e sys/arch/aarch64/aarch64/db_machdep.c
--- a/sys/arch/aarch64/aarch64/db_machdep.c     Mon May 02 09:43:23 2022 +0000
+++ b/sys/arch/aarch64/aarch64/db_machdep.c     Mon May 02 10:13:15 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.c,v 1.42 2021/10/31 16:23:47 skrll Exp $ */
+/* $NetBSD: db_machdep.c,v 1.43 2022/05/02 10:13:15 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.42 2021/10/31 16:23:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.43 2022/05/02 10:13:15 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd32.h"
@@ -456,17 +456,29 @@
        paddr_t pa = (__SHIFTOUT(par, PAR_PA) << PAR_PA_SHIFT) +
            (va & __BITS(PAR_PA_SHIFT - 1, 0));
 
-       db_printf("%016"PRIx64": ATTR=0x%02lx, NS=%ld, S=%ld, SHA=%ld, PTW=%ld"
-           ", FST=%ld, F=%ld, PA=%016"PRIxPADDR"\n",
-           par,
-           __SHIFTOUT(par, PAR_ATTR),
-           __SHIFTOUT(par, PAR_NS),
-           __SHIFTOUT(par, PAR_S),
-           __SHIFTOUT(par, PAR_SHA),
-           __SHIFTOUT(par, PAR_PTW),
-           __SHIFTOUT(par, PAR_FST),
-           __SHIFTOUT(par, PAR_F),
-           pa);
+       if (__SHIFTOUT(par, PAR_F) == 0) {
+               db_printf("%016" PRIx64
+                   ": ATTR=0x%02" __PRIxBITS
+                   ", NS=%" __PRIuBITS
+                   ", SH=%" __PRIuBITS
+                   ", PA=%016" PRIxPADDR
+                   " (no fault)\n",
+                   par,
+                   __SHIFTOUT(par, PAR_ATTR),
+                   __SHIFTOUT(par, PAR_NS),
+                   __SHIFTOUT(par, PAR_SH),
+                   pa);
+       } else {
+               db_printf("%016" PRIx64
+                   ", S=%" __PRIuBITS
+                   ", PTW=%" __PRIuBITS
+                   ", FST=%" __PRIuBITS
+                   " (fault)\n",
+                   par,
+                   __SHIFTOUT(par, PAR_S),
+                   __SHIFTOUT(par, PAR_PTW),
+                   __SHIFTOUT(par, PAR_FST));
+       }
 }
 
 void
diff -r b64eb3b5937b -r e45842a3935e sys/arch/aarch64/include/armreg.h
--- a/sys/arch/aarch64/include/armreg.h Mon May 02 09:43:23 2022 +0000
+++ b/sys/arch/aarch64/include/armreg.h Mon May 02 10:13:15 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: armreg.h,v 1.60 2022/01/05 19:53:32 ryo Exp $ */
+/* $NetBSD: armreg.h,v 1.61 2022/05/02 10:13:15 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -788,11 +788,12 @@
 #define        PAR_PA                  __BITS(51,12)   // F=0 physical address
 #define        PAR_PA_SHIFT            12
 #define        PAR_NS                  __BIT(9)        // F=0 non-secure
+#define        PAR_SH                  __BITS(8,7)     // F=0 shareability attribute
+#define         PAR_SH_NONE             0
+#define         PAR_SH_OUTER            2
+#define         PAR_SH_INNER            3
+
 #define        PAR_S                   __BIT(9)        // F=1 failure stage
-#define        PAR_SHA                 __BITS(8,7)     // F=0 shareability attribute
-#define         PAR_SHA_NONE            0
-#define         PAR_SHA_OUTER           2
-#define         PAR_SHA_INNER           3
 #define        PAR_PTW                 __BIT(8)        // F=1 partial table walk
 #define        PAR_FST                 __BITS(6,1)     // F=1 fault status code
 #define        PAR_F                   __BIT(0)        // translation failed



Home | Main Index | Thread Index | Old Index