summaryrefslogtreecommitdiff
path: root/target-moxie
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-05-27 01:33:50 +0200
committerAndreas Färber <afaerber@suse.de>2013-06-28 13:25:12 +0200
commit878096eeb278a8ac1ccd6667af73e026f29b4cf5 (patch)
tree1f2ad77025073e5d4b13de7a1df63772d7915ced /target-moxie
parent13618e058cf2d76bccc41251fa0095aae88a8249 (diff)
downloadqemu-878096eeb278a8ac1ccd6667af73e026f29b4cf5.tar.gz
qemu-878096eeb278a8ac1ccd6667af73e026f29b4cf5.tar.bz2
qemu-878096eeb278a8ac1ccd6667af73e026f29b4cf5.zip
cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks
Make cpustats monitor command available unconditionally. Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec() arguments to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-moxie')
-rw-r--r--target-moxie/cpu.c3
-rw-r--r--target-moxie/cpu.h2
-rw-r--r--target-moxie/helper.c4
-rw-r--r--target-moxie/translate.c6
4 files changed, 11 insertions, 4 deletions
diff --git a/target-moxie/cpu.c b/target-moxie/cpu.c
index f2b0791b91..3c3932c129 100644
--- a/target-moxie/cpu.c
+++ b/target-moxie/cpu.c
@@ -97,8 +97,9 @@ static void moxie_cpu_class_init(ObjectClass *oc, void *data)
cc->class_by_name = moxie_cpu_class_by_name;
- cpu_class_set_vmsd(cc, &vmstate_moxie_cpu);
cc->do_interrupt = moxie_cpu_do_interrupt;
+ cc->dump_state = moxie_cpu_dump_state;
+ cpu_class_set_vmsd(cc, &vmstate_moxie_cpu);
}
static void moxielite_initfn(Object *obj)
diff --git a/target-moxie/cpu.h b/target-moxie/cpu.h
index a9d9ace303..374b24af52 100644
--- a/target-moxie/cpu.h
+++ b/target-moxie/cpu.h
@@ -116,6 +116,8 @@ static inline MoxieCPU *moxie_env_get_cpu(CPUMoxieState *env)
MoxieCPU *cpu_moxie_init(const char *cpu_model);
int cpu_moxie_exec(CPUMoxieState *s);
void moxie_cpu_do_interrupt(CPUState *cs);
+void moxie_cpu_dump_state(CPUState *cpu, FILE *f,
+ fprintf_function cpu_fprintf, int flags);
void moxie_translate_init(void);
int cpu_moxie_signal_handler(int host_signum, void *pinfo,
void *puc);
diff --git a/target-moxie/helper.c b/target-moxie/helper.c
index 5cfe889ad4..ea0788fcea 100644
--- a/target-moxie/helper.c
+++ b/target-moxie/helper.c
@@ -110,9 +110,11 @@ void moxie_cpu_do_interrupt(CPUState *env)
int cpu_moxie_handle_mmu_fault(CPUMoxieState *env, target_ulong address,
int rw, int mmu_idx)
{
+ MoxieCPU *cpu = moxie_env_get_cpu(env);
+
env->exception_index = 0xaa;
env->debug1 = address;
- cpu_dump_state(env, stderr, fprintf, 0);
+ cpu_dump_state(CPU(cpu), stderr, fprintf, 0);
return 1;
}
diff --git a/target-moxie/translate.c b/target-moxie/translate.c
index cc02bd36f2..b0ae38a4d5 100644
--- a/target-moxie/translate.c
+++ b/target-moxie/translate.c
@@ -74,9 +74,11 @@ static int extract_branch_offset(int opcode)
return (((signed short)((opcode & ((1 << 10) - 1)) << 6)) >> 6) << 1;
}
-void cpu_dump_state(CPUArchState *env, FILE *f, fprintf_function cpu_fprintf,
- int flags)
+void moxie_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
+ int flags)
{
+ MoxieCPU *cpu = MOXIE_CPU(cs);
+ CPUMoxieState *env = &cpu->env;
int i;
cpu_fprintf(f, "pc=0x%08x\n", env->pc);
cpu_fprintf(f, "$fp=0x%08x $sp=0x%08x $r0=0x%08x $r1=0x%08x\n",