aboutsummaryrefslogtreecommitdiff
path: root/target-m68k/op_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-m68k/op_helper.c')
-rw-r--r--target-m68k/op_helper.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/target-m68k/op_helper.c b/target-m68k/op_helper.c
index 9dd3e74ab8..06661f58ca 100644
--- a/target-m68k/op_helper.c
+++ b/target-m68k/op_helper.c
@@ -27,7 +27,7 @@ void m68k_cpu_do_interrupt(CPUState *cs)
cs->exception_index = -1;
}
-void do_interrupt_m68k_hardirq(CPUM68KState *env)
+static inline void do_interrupt_m68k_hardirq(CPUM68KState *env)
{
}
@@ -141,12 +141,30 @@ void m68k_cpu_do_interrupt(CPUState *cs)
do_interrupt_all(env, 0);
}
-void do_interrupt_m68k_hardirq(CPUM68KState *env)
+static inline void do_interrupt_m68k_hardirq(CPUM68KState *env)
{
do_interrupt_all(env, 1);
}
#endif
+bool m68k_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
+{
+ M68kCPU *cpu = M68K_CPU(cs);
+ CPUM68KState *env = &cpu->env;
+
+ if (interrupt_request & CPU_INTERRUPT_HARD
+ && ((env->sr & SR_I) >> SR_I_SHIFT) < env->pending_level) {
+ /* Real hardware gets the interrupt vector via an IACK cycle
+ at this point. Current emulated hardware doesn't rely on
+ this, so we provide/save the vector when the interrupt is
+ first signalled. */
+ cs->exception_index = env->pending_vector;
+ do_interrupt_m68k_hardirq(env);
+ return true;
+ }
+ return false;
+}
+
static void raise_exception(CPUM68KState *env, int tt)
{
CPUState *cs = CPU(m68k_env_get_cpu(env));