mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-09 00:07:57 -06:00
target-openrisc: Use cpu_exec_interrupt qom hook
Cc: Jia Liu <proljc@gmail.com> Signed-off-by: Richard Henderson <rth@twiddle.net> Tested-by: Jia Liu <proljc@gmail.com> Message-id: 1410626734-3804-17-git-send-email-rth@twiddle.net Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
87afe467e2
commit
fbb96c4b7f
4 changed files with 22 additions and 18 deletions
|
@ -63,3 +63,23 @@ void openrisc_cpu_do_interrupt(CPUState *cs)
|
|||
|
||||
cs->exception_index = -1;
|
||||
}
|
||||
|
||||
bool openrisc_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
OpenRISCCPU *cpu = OPENRISC_CPU(cs);
|
||||
CPUOpenRISCState *env = &cpu->env;
|
||||
int idx = -1;
|
||||
|
||||
if ((interrupt_request & CPU_INTERRUPT_HARD) && (env->sr & SR_IEE)) {
|
||||
idx = EXCP_INT;
|
||||
}
|
||||
if ((interrupt_request & CPU_INTERRUPT_TIMER) && (env->sr & SR_TEE)) {
|
||||
idx = EXCP_TICK;
|
||||
}
|
||||
if (idx >= 0) {
|
||||
cs->exception_index = idx;
|
||||
openrisc_cpu_do_interrupt(cs);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue