[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/61] target/hppa: Adjust hppa_cpu_dump_state for hppa64
From: |
Richard Henderson |
Subject: |
[PATCH 18/61] target/hppa: Adjust hppa_cpu_dump_state for hppa64 |
Date: |
Wed, 18 Oct 2023 14:50:52 -0700 |
Dump all 64 bits for pa2.0 and low 32 bits for pa1.x.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hppa/helper.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/target/hppa/helper.c b/target/hppa/helper.c
index 0ef890184a..04cdbafe9d 100644
--- a/target/hppa/helper.c
+++ b/target/hppa/helper.c
@@ -124,13 +124,17 @@ void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags)
target_ureg psw = cpu_hppa_get_psw(env);
target_ureg psw_cb;
char psw_c[20];
- int i;
+ int i, w;
+ uint64_t m;
+
+ w = cpu->is_pa20 ? 16 : 8;
+ m = cpu->is_pa20 ? UINT64_MAX : UINT32_MAX;
qemu_fprintf(f, "IA_F " TARGET_FMT_lx " IA_B " TARGET_FMT_lx
- " IIR " TREG_FMT_lx "\n",
+ " IIR %0*" PRIx64 "\n",
hppa_form_gva_psw(psw, env->iasq_f, env->iaoq_f),
hppa_form_gva_psw(psw, env->iasq_b, env->iaoq_b),
- env->cr[CR_IIR]);
+ w, m & env->cr[CR_IIR]);
psw_c[0] = (psw & PSW_W ? 'W' : '-');
psw_c[1] = (psw & PSW_E ? 'E' : '-');
@@ -151,13 +155,15 @@ void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags)
psw_c[16] = (psw & PSW_D ? 'D' : '-');
psw_c[17] = (psw & PSW_I ? 'I' : '-');
psw_c[18] = '\0';
- psw_cb = ((env->psw_cb >> 4) & 0x01111111) | (env->psw_cb_msb << 28);
+ psw_cb = ((env->psw_cb >> 4) & ((target_ureg)-1 / 0xf))
+ | (env->psw_cb_msb << (TARGET_REGISTER_BITS - 4));
- qemu_fprintf(f, "PSW " TREG_FMT_lx " CB " TREG_FMT_lx " %s\n",
- psw, psw_cb, psw_c);
+ qemu_fprintf(f, "PSW %0*" PRIx64 " CB %0*" PRIx64 " %s\n",
+ w, m & psw, w, m & psw_cb, psw_c);
for (i = 0; i < 32; i++) {
- qemu_fprintf(f, "GR%02d " TREG_FMT_lx "%c", i, env->gr[i],
+ qemu_fprintf(f, "GR%02d %0*" PRIx64 "%c",
+ i, w, m & env->gr[i],
(i & 3) == 3 ? '\n' : ' ');
}
#ifndef CONFIG_USER_ONLY
--
2.34.1
- Re: [PATCH 02/61] target/hppa: Remove get_temp, (continued)
- [PATCH 05/61] target/hppa: Fix hppa64 case in machine.c, Richard Henderson, 2023/10/18
- [PATCH 06/61] target/hppa: Fix load in do_load_32, Richard Henderson, 2023/10/18
- [PATCH 03/61] target/hppa: Remove get_temp_tl, Richard Henderson, 2023/10/18
- [PATCH 07/61] target/hppa: Truncate rotate count in trans_shrpw_sar, Richard Henderson, 2023/10/18
- [PATCH 08/61] target/hppa: Fix trans_ds for hppa64, Richard Henderson, 2023/10/18
- [PATCH 09/61] target/hppa: Fix do_add, do_sub for hppa64, Richard Henderson, 2023/10/18
- [PATCH 13/61] target/hppa: Make HPPA_BTLB_ENTRIES variable, Richard Henderson, 2023/10/18
- [PATCH 18/61] target/hppa: Adjust hppa_cpu_dump_state for hppa64,
Richard Henderson <=
- [PATCH 12/61] target/hppa: Introduce TYPE_HPPA64_CPU, Richard Henderson, 2023/10/18
- [PATCH 28/61] target/hppa: Drop attempted gdbstub support for hppa64, Richard Henderson, 2023/10/18
- [PATCH 31/61] target/hppa: Decode d for unit instructions, Richard Henderson, 2023/10/18
- [PATCH 11/61] target/hppa: Fix extrw and depw with sar for hppa64, Richard Henderson, 2023/10/18
- [PATCH 14/61] target/hppa: Implement cpu_list, Richard Henderson, 2023/10/18
- [PATCH 17/61] target/hppa: Handle absolute addresses for pa2.0, Richard Henderson, 2023/10/18
- [PATCH 30/61] target/hppa: Decode d for logical instructions, Richard Henderson, 2023/10/18
- [PATCH 27/61] linux-user/hppa: Fixes for TARGET_ABI32, Richard Henderson, 2023/10/18