[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 18/53] target/nios2: convert to use format_state instead of du
From: |
Daniel P . Berrangé |
Subject: |
[PATCH v2 18/53] target/nios2: convert to use format_state instead of dump_state |
Date: |
Tue, 14 Sep 2021 15:20:07 +0100 |
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
target/nios2/cpu.c | 2 +-
target/nios2/cpu.h | 2 +-
target/nios2/translate.c | 20 ++++++++++----------
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c
index 5e37defef8..cbf15fb1c9 100644
--- a/target/nios2/cpu.c
+++ b/target/nios2/cpu.c
@@ -241,7 +241,7 @@ static void nios2_cpu_class_init(ObjectClass *oc, void
*data)
cc->class_by_name = nios2_cpu_class_by_name;
cc->has_work = nios2_cpu_has_work;
- cc->dump_state = nios2_cpu_dump_state;
+ cc->format_state = nios2_cpu_format_state;
cc->set_pc = nios2_cpu_set_pc;
cc->disas_set_info = nios2_cpu_disas_set_info;
#ifndef CONFIG_USER_ONLY
diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h
index 2ab82fdc71..3b16cd1f3c 100644
--- a/target/nios2/cpu.h
+++ b/target/nios2/cpu.h
@@ -195,7 +195,7 @@ void nios2_tcg_init(void);
void nios2_cpu_do_interrupt(CPUState *cs);
int cpu_nios2_signal_handler(int host_signum, void *pinfo, void *puc);
void dump_mmu(CPUNios2State *env);
-void nios2_cpu_dump_state(CPUState *cpu, FILE *f, int flags);
+void nios2_cpu_format_state(CPUState *cpu, GString *buf, int flags);
hwaddr nios2_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
void nios2_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
MMUAccessType access_type,
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 08d7ac5398..a5f0f56e1a 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -855,7 +855,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock
*tb, int max_insns)
translator_loop(&nios2_tr_ops, &dc.base, cs, tb, max_insns);
}
-void nios2_cpu_dump_state(CPUState *cs, FILE *f, int flags)
+void nios2_cpu_format_state(CPUState *cs, GString *buf, int flags)
{
Nios2CPU *cpu = NIOS2_CPU(cs);
CPUNios2State *env = &cpu->env;
@@ -865,22 +865,22 @@ void nios2_cpu_dump_state(CPUState *cs, FILE *f, int
flags)
return;
}
- qemu_fprintf(f, "IN: PC=%x %s\n",
- env->regs[R_PC], lookup_symbol(env->regs[R_PC]));
+ g_string_append_printf(buf, "IN: PC=%x %s\n",
+ env->regs[R_PC], lookup_symbol(env->regs[R_PC]));
for (i = 0; i < NUM_CORE_REGS; i++) {
- qemu_fprintf(f, "%9s=%8.8x ", regnames[i], env->regs[i]);
+ g_string_append_printf(buf, "%9s=%8.8x ", regnames[i], env->regs[i]);
if ((i + 1) % 4 == 0) {
- qemu_fprintf(f, "\n");
+ g_string_append_printf(buf, "\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,
- env->mmu.tlbacc_wr);
+ g_string_append_printf(buf, " 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,
+ env->mmu.tlbacc_wr);
#endif
- qemu_fprintf(f, "\n\n");
+ g_string_append_printf(buf, "\n\n");
}
void nios2_tcg_init(void)
--
2.31.1
- [PATCH v2 14/53] target/i386: convert to use format_state instead of dump_state, (continued)
- [PATCH v2 17/53] target/mips: convert to use format_state instead of dump_state, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 18/53] target/nios2: convert to use format_state instead of dump_state,
Daniel P . Berrangé <=
- [PATCH v2 19/53] target/openrisc: convert to use format_state instead of dump_state, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 20/53] target/ppc: convert to use format_state instead of dump_state, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 21/53] target/riscv: convert to use format_state instead of dump_state, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 22/53] target/rx: convert to use format_state instead of dump_state, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 23/53] target/s390x: convert to use format_state instead of dump_state, Daniel P . Berrangé, 2021/09/14