[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL for-2.10 09/14] target/s390x: Move s390_cpu_dump_stat
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL for-2.10 09/14] target/s390x: Move s390_cpu_dump_state() to helper.c |
Date: |
Tue, 25 Jul 2017 11:40:21 +0200 |
From: Thomas Huth <address@hidden>
translate.c can not be compiled with --disable-tcg, but we need
the s390_cpu_dump_state() in KVM-only builds, too. So let's move
that function to helper.c instead, which will also be compiled
when --disable-tcg has been specified.
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
target/s390x/helper.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++
target/s390x/translate.c | 60 ------------------------------------------------
2 files changed, 60 insertions(+), 60 deletions(-)
diff --git a/target/s390x/helper.c b/target/s390x/helper.c
index aef09e1234..30ac2a77b3 100644
--- a/target/s390x/helper.c
+++ b/target/s390x/helper.c
@@ -766,3 +766,63 @@ void s390x_cpu_do_unaligned_access(CPUState *cs, vaddr
addr,
program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO);
}
#endif /* CONFIG_USER_ONLY */
+
+void s390_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
+ int flags)
+{
+ S390CPU *cpu = S390_CPU(cs);
+ CPUS390XState *env = &cpu->env;
+ int i;
+
+ if (env->cc_op > 3) {
+ cpu_fprintf(f, "PSW=mask %016" PRIx64 " addr %016" PRIx64 " cc %15s\n",
+ env->psw.mask, env->psw.addr, cc_name(env->cc_op));
+ } else {
+ cpu_fprintf(f, "PSW=mask %016" PRIx64 " addr %016" PRIx64 " cc %02x\n",
+ env->psw.mask, env->psw.addr, env->cc_op);
+ }
+
+ for (i = 0; i < 16; i++) {
+ cpu_fprintf(f, "R%02d=%016" PRIx64, i, env->regs[i]);
+ if ((i % 4) == 3) {
+ cpu_fprintf(f, "\n");
+ } else {
+ cpu_fprintf(f, " ");
+ }
+ }
+
+ for (i = 0; i < 16; i++) {
+ cpu_fprintf(f, "F%02d=%016" PRIx64, i, get_freg(env, i)->ll);
+ if ((i % 4) == 3) {
+ cpu_fprintf(f, "\n");
+ } else {
+ cpu_fprintf(f, " ");
+ }
+ }
+
+ for (i = 0; i < 32; i++) {
+ cpu_fprintf(f, "V%02d=%016" PRIx64 "%016" PRIx64, i,
+ env->vregs[i][0].ll, env->vregs[i][1].ll);
+ cpu_fprintf(f, (i % 2) ? "\n" : " ");
+ }
+
+#ifndef CONFIG_USER_ONLY
+ for (i = 0; i < 16; i++) {
+ cpu_fprintf(f, "C%02d=%016" PRIx64, i, env->cregs[i]);
+ if ((i % 4) == 3) {
+ cpu_fprintf(f, "\n");
+ } else {
+ cpu_fprintf(f, " ");
+ }
+ }
+#endif
+
+#ifdef DEBUG_INLINE_BRANCHES
+ for (i = 0; i < CC_OP_MAX; i++) {
+ cpu_fprintf(f, " %15s = %10ld\t%10ld\n", cc_name(i),
+ inline_branch_miss[i], inline_branch_hit[i]);
+ }
+#endif
+
+ cpu_fprintf(f, "\n");
+}
diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index 48b71f9604..cd96a8dee2 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -93,66 +93,6 @@ static uint64_t pc_to_link_info(DisasContext *s, uint64_t pc)
return pc;
}
-void s390_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
- int flags)
-{
- S390CPU *cpu = S390_CPU(cs);
- CPUS390XState *env = &cpu->env;
- int i;
-
- if (env->cc_op > 3) {
- cpu_fprintf(f, "PSW=mask %016" PRIx64 " addr %016" PRIx64 " cc %15s\n",
- env->psw.mask, env->psw.addr, cc_name(env->cc_op));
- } else {
- cpu_fprintf(f, "PSW=mask %016" PRIx64 " addr %016" PRIx64 " cc %02x\n",
- env->psw.mask, env->psw.addr, env->cc_op);
- }
-
- for (i = 0; i < 16; i++) {
- cpu_fprintf(f, "R%02d=%016" PRIx64, i, env->regs[i]);
- if ((i % 4) == 3) {
- cpu_fprintf(f, "\n");
- } else {
- cpu_fprintf(f, " ");
- }
- }
-
- for (i = 0; i < 16; i++) {
- cpu_fprintf(f, "F%02d=%016" PRIx64, i, get_freg(env, i)->ll);
- if ((i % 4) == 3) {
- cpu_fprintf(f, "\n");
- } else {
- cpu_fprintf(f, " ");
- }
- }
-
- for (i = 0; i < 32; i++) {
- cpu_fprintf(f, "V%02d=%016" PRIx64 "%016" PRIx64, i,
- env->vregs[i][0].ll, env->vregs[i][1].ll);
- cpu_fprintf(f, (i % 2) ? "\n" : " ");
- }
-
-#ifndef CONFIG_USER_ONLY
- for (i = 0; i < 16; i++) {
- cpu_fprintf(f, "C%02d=%016" PRIx64, i, env->cregs[i]);
- if ((i % 4) == 3) {
- cpu_fprintf(f, "\n");
- } else {
- cpu_fprintf(f, " ");
- }
- }
-#endif
-
-#ifdef DEBUG_INLINE_BRANCHES
- for (i = 0; i < CC_OP_MAX; i++) {
- cpu_fprintf(f, " %15s = %10ld\t%10ld\n", cc_name(i),
- inline_branch_miss[i], inline_branch_hit[i]);
- }
-#endif
-
- cpu_fprintf(f, "\n");
-}
-
static TCGv_i64 psw_addr;
static TCGv_i64 psw_mask;
static TCGv_i64 gbea;
--
2.13.3
- [Qemu-devel] [PULL for-2.10 00/14] A set of s390x patches, Cornelia Huck, 2017/07/25
- [Qemu-devel] [PULL for-2.10 01/14] vfio/ccw: allocate irq info with the right size, Cornelia Huck, 2017/07/25
- [Qemu-devel] [PULL for-2.10 02/14] vfio/ccw: fix initialization of the Object DeviceState pointer in the common base-device, Cornelia Huck, 2017/07/25
- [Qemu-devel] [PULL for-2.10 03/14] s390/cpumodel: remove KSS from the default model of z14, Cornelia Huck, 2017/07/25
- [Qemu-devel] [PULL for-2.10 04/14] target/s390x: drop BE_BIT(), Cornelia Huck, 2017/07/25
- [Qemu-devel] [PULL for-2.10 06/14] target/s390x: introduce (test|set)_be_bit, Cornelia Huck, 2017/07/25
- [Qemu-devel] [PULL for-2.10 05/14] target/s390x: indicate query subfunction in s390_fill_feat_block, Cornelia Huck, 2017/07/25
- [Qemu-devel] [PULL for-2.10 07/14] s390x/kvm: better comment regarding zPCI feature availability, Cornelia Huck, 2017/07/25
- [Qemu-devel] [PULL for-2.10 08/14] target/s390x: improve baselining if certain base features are missing, Cornelia Huck, 2017/07/25
- [Qemu-devel] [PULL for-2.10 09/14] target/s390x: Move s390_cpu_dump_state() to helper.c,
Cornelia Huck <=
- [Qemu-devel] [PULL for-2.10 10/14] target/s390x: Move diag helpers to a separate file, Cornelia Huck, 2017/07/25
- [Qemu-devel] [PULL for-2.10 11/14] target/s390x: Rework program_interrupt() and related functions, Cornelia Huck, 2017/07/25
- [Qemu-devel] [PULL for-2.10 13/14] target/s390x: Add remaining switches to compile with --disable-tcg, Cornelia Huck, 2017/07/25
- [Qemu-devel] [PULL for-2.10 12/14] target/s390x: Move exception-related functions to a new excp_helper.c file, Cornelia Huck, 2017/07/25
- [Qemu-devel] [PULL for-2.10 14/14] s390x/css: fix ilen in IO instruction handlers, Cornelia Huck, 2017/07/25
- Re: [Qemu-devel] [PULL for-2.10 00/14] A set of s390x patches, no-reply, 2017/07/25
- Re: [Qemu-devel] [PULL for-2.10 00/14] A set of s390x patches, Peter Maydell, 2017/07/25