[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 10/33] target/nios2: Clean up nios2_cpu_dump_state
From: |
Richard Henderson |
Subject: |
[PATCH v4 10/33] target/nios2: Clean up nios2_cpu_dump_state |
Date: |
Mon, 7 Mar 2022 21:19:42 -1000 |
Do not print control registers for user-only mode.
Rename reserved control registers to "resN", where
N is the control register index.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/nios2/translate.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 2942921724..7a32e6626d 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -754,7 +754,7 @@ illegal_op:
t_gen_helper_raise_exception(dc, EXCP_ILLEGAL);
}
-static const char * const gr_regnames[] = {
+static const char * const gr_regnames[NUM_GP_REGS] = {
"zero", "at", "r2", "r3",
"r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11",
@@ -765,17 +765,18 @@ static const char * const gr_regnames[] = {
"fp", "ea", "ba", "ra",
};
-static const char * const cr_regnames[] = {
+#ifndef CONFIG_USER_ONLY
+static const char * const cr_regnames[NUM_CR_REGS] = {
"status", "estatus", "bstatus", "ienable",
- "ipending", "cpuid", "reserved0", "exception",
+ "ipending", "cpuid", "res6", "exception",
"pteaddr", "tlbacc", "tlbmisc", "reserved1",
"badaddr", "config", "mpubase", "mpuacc",
- "reserved2", "reserved3", "reserved4", "reserved5",
- "reserved6", "reserved7", "reserved8", "reserved9",
- "reserved10", "reserved11", "reserved12", "reserved13",
- "reserved14", "reserved15", "reserved16", "reserved17",
- "rpc"
+ "res16", "res17", "res18", "res19",
+ "res20", "res21", "res22", "res23",
+ "res24", "res25", "res26", "res27",
+ "res28", "res29", "res30", "res31",
};
+#endif
#include "exec/gen-icount.h"
@@ -899,13 +900,14 @@ void nios2_cpu_dump_state(CPUState *cs, FILE *f, int
flags)
qemu_fprintf(f, "\n");
}
}
+
+#if !defined(CONFIG_USER_ONLY)
for (i = 0; i < NUM_CR_REGS; i++) {
qemu_fprintf(f, "%9s=%8.8x ", cr_regnames[i], env->ctrl[i]);
if ((i + 1) % 4 == 0) {
qemu_fprintf(f, "\n");
}
}
-#if !defined(CONFIG_USER_ONLY)
qemu_fprintf(f, " mmu write: VPN=%05X PID %02X TLBACC %08X\n",
env->mmu.pteaddr_wr & CR_PTEADDR_VPN_MASK,
(env->mmu.tlbmisc_wr & CR_TLBMISC_PID_MASK) >> 4,
--
2.25.1
- Re: [PATCH v4 17/33] target/nios2: Prevent writes to read-only or reserved control fields, (continued)
- [PATCH v4 13/33] target/nios2: Use hw/registerfields.h for CR_TLBADDR fields, Richard Henderson, 2022/03/08
- [PATCH v4 16/33] target/nios2: Move R_FOO and CR_BAR into enumerations, Richard Henderson, 2022/03/08
- [PATCH v4 24/33] target/nios2: Introduce shadow register sets, Richard Henderson, 2022/03/08
- [PATCH v4 10/33] target/nios2: Clean up nios2_cpu_dump_state,
Richard Henderson <=
- [PATCH v4 19/33] target/nios2: Implement CR_STATUS.RSIE, Richard Henderson, 2022/03/08
- [PATCH v4 20/33] target/nios2: Remove CPU_INTERRUPT_NMI, Richard Henderson, 2022/03/08
- [PATCH v4 25/33] target/nios2: Implement rdprs, wrprs, Richard Henderson, 2022/03/08
- [PATCH v4 23/33] target/nios2: Drop CR_STATUS_EH from tb->flags, Richard Henderson, 2022/03/08
- [PATCH v4 21/33] target/nios2: Use tcg_constant_tl, Richard Henderson, 2022/03/08