[PATCH 8/8] ppc/ppc405: Dump specific registers

Cédric Le Goater posted 8 patches 4 years, 1 month ago
Maintainers: Daniel Henrique Barboza <danielhb413@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, Greg Kurz <groug@kaod.org>, David Gibson <david@gibson.dropbear.id.au>
There is a newer version of this series
[PATCH 8/8] ppc/ppc405: Dump specific registers
Posted by Cédric Le Goater 4 years, 1 month ago
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 target/ppc/cpu_init.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 9ef9a1a5ddd5..8f6a58e82483 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -8689,6 +8689,17 @@ void ppc_cpu_dump_state(CPUState *cs, FILE *f, int flags)
          * they can be read with "p $ivor0", "p $ivor1", etc.
          */
     }
+    if (env->excp_model == POWERPC_EXCP_40x) {
+        qemu_fprintf(f, "  TCR " TARGET_FMT_lx "   TSR " TARGET_FMT_lx
+                     "    ESR " TARGET_FMT_lx "   DEAR " TARGET_FMT_lx "\n",
+                     env->spr[SPR_40x_TCR], env->spr[SPR_40x_TSR],
+                     env->spr[SPR_40x_ESR], env->spr[SPR_40x_DEAR]);
+
+        qemu_fprintf(f, " EVPR " TARGET_FMT_lx "  SRR2 " TARGET_FMT_lx
+                     "   SRR3 " TARGET_FMT_lx  "   PID " TARGET_FMT_lx "\n",
+                     env->spr[SPR_40x_EVPR], env->spr[SPR_40x_SRR2],
+                     env->spr[SPR_40x_SRR3], env->spr[SPR_40x_PID]);
+    }
 
 #if defined(TARGET_PPC64)
     if (env->flags & POWERPC_FLAG_CFAR) {
-- 
2.31.1


Re: [PATCH 8/8] ppc/ppc405: Dump specific registers
Posted by Richard Henderson 4 years, 1 month ago
On 12/21/21 10:40 PM, Cédric Le Goater wrote:
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>   target/ppc/cpu_init.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> index 9ef9a1a5ddd5..8f6a58e82483 100644
> --- a/target/ppc/cpu_init.c
> +++ b/target/ppc/cpu_init.c
> @@ -8689,6 +8689,17 @@ void ppc_cpu_dump_state(CPUState *cs, FILE *f, int flags)
>            * they can be read with "p $ivor0", "p $ivor1", etc.
>            */
>       }
> +    if (env->excp_model == POWERPC_EXCP_40x) {

Perhaps turn this and the previous booke test into a switch.

Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

> +        qemu_fprintf(f, "  TCR " TARGET_FMT_lx "   TSR " TARGET_FMT_lx
> +                     "    ESR " TARGET_FMT_lx "   DEAR " TARGET_FMT_lx "\n",
> +                     env->spr[SPR_40x_TCR], env->spr[SPR_40x_TSR],
> +                     env->spr[SPR_40x_ESR], env->spr[SPR_40x_DEAR]);
> +
> +        qemu_fprintf(f, " EVPR " TARGET_FMT_lx "  SRR2 " TARGET_FMT_lx
> +                     "   SRR3 " TARGET_FMT_lx  "   PID " TARGET_FMT_lx "\n",
> +                     env->spr[SPR_40x_EVPR], env->spr[SPR_40x_SRR2],
> +                     env->spr[SPR_40x_SRR3], env->spr[SPR_40x_PID]);
> +    }
>   
>   #if defined(TARGET_PPC64)
>       if (env->flags & POWERPC_FLAG_CFAR) {
>