summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpu-exec.c13
-rw-r--r--target-m68k/cpu-qom.h3
-rw-r--r--target-m68k/cpu.c3
-rw-r--r--target-m68k/helper.c20
4 files changed, 27 insertions, 12 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index 0c1f0d3..9f84dda 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -352,11 +352,7 @@ int cpu_exec(CPUArchState *env)
cpu->exit_request = 1;
}
-#if defined(TARGET_M68K)
- env->cc_op = CC_OP_FLAGS;
- env->cc_dest = env->sr & 0xf;
- env->cc_x = (env->sr >> 4) & 1;
-#elif defined(TARGET_PPC)
+#if defined(TARGET_PPC)
env->reserve_addr = -1;
#endif
cc->cpu_exec_enter(cpu);
@@ -804,13 +800,6 @@ int cpu_exec(CPUArchState *env)
}
} /* for(;;) */
-
-#if defined(TARGET_M68K)
- cpu_m68k_flush_flags(env, env->cc_op);
- env->cc_op = CC_OP_FLAGS;
- env->sr = (env->sr & 0xffe0)
- | env->cc_dest | (env->cc_x << 4);
-#endif
cc->cpu_exec_exit(cpu);
/* fail safe : never use current_cpu outside cpu_exec() */
diff --git a/target-m68k/cpu-qom.h b/target-m68k/cpu-qom.h
index 7f388ed..41b14ae 100644
--- a/target-m68k/cpu-qom.h
+++ b/target-m68k/cpu-qom.h
@@ -77,4 +77,7 @@ hwaddr m68k_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
int m68k_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
int m68k_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
+void m68k_cpu_exec_enter(CPUState *cs);
+void m68k_cpu_exec_exit(CPUState *cs);
+
#endif
diff --git a/target-m68k/cpu.c b/target-m68k/cpu.c
index c9cff19..5a58d51 100644
--- a/target-m68k/cpu.c
+++ b/target-m68k/cpu.c
@@ -205,6 +205,9 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data)
#else
cc->get_phys_page_debug = m68k_cpu_get_phys_page_debug;
#endif
+ cc->cpu_exec_enter = m68k_cpu_exec_enter;
+ cc->cpu_exec_exit = m68k_cpu_exec_exit;
+
dc->vmsd = &vmstate_m68k_cpu;
cc->gdb_num_core_regs = 18;
cc->gdb_core_xml_file = "cf-core.xml";
diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index 8be9745..77225a2 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -864,3 +864,23 @@ void HELPER(set_mac_extu)(CPUM68KState *env, uint32_t val, uint32_t acc)
res |= (uint64_t)(val & 0xffff0000) << 16;
env->macc[acc + 1] = res;
}
+
+void m68k_cpu_exec_enter(CPUState *cs)
+{
+ M68kCPU *cpu = M68K_CPU(cs);
+ CPUM68KState *env = &cpu->env;
+
+ env->cc_op = CC_OP_FLAGS;
+ env->cc_dest = env->sr & 0xf;
+ env->cc_x = (env->sr >> 4) & 1;
+}
+
+void m68k_cpu_exec_exit(CPUState *cs)
+{
+ M68kCPU *cpu = M68K_CPU(cs);
+ CPUM68KState *env = &cpu->env;
+
+ cpu_m68k_flush_flags(env, env->cc_op);
+ env->cc_op = CC_OP_FLAGS;
+ env->sr = (env->sr & 0xffe0) | env->cc_dest | (env->cc_x << 4);
+}
OpenPOWER on IntegriCloud