target-lm32: Use cpu_exec_interrupt qom hook

Cc: Michael Walle <michael@walle.cc>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Acked-by: Michael Walle <michael@walle.cc>
Message-id: 1410626734-3804-21-git-send-email-rth@twiddle.net
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Richard Henderson 2014-09-13 09:45:31 -07:00 committed by Peter Maydell
parent 29cd33d3c7
commit e9854c3945
4 changed files with 15 additions and 7 deletions

View file

@ -202,6 +202,19 @@ void lm32_cpu_do_interrupt(CPUState *cs)
}
}
bool lm32_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
{
LM32CPU *cpu = LM32_CPU(cs);
CPULM32State *env = &cpu->env;
if ((interrupt_request & CPU_INTERRUPT_HARD) && (env->ie & IE_IE)) {
cs->exception_index = EXCP_IRQ;
lm32_cpu_do_interrupt(cs);
return true;
}
return false;
}
LM32CPU *cpu_lm32_init(const char *cpu_model)
{
return LM32_CPU(cpu_generic_init(TYPE_LM32_CPU, cpu_model));