From b6a71ef7e01bcac7aeb47d8de4082704fbc6479c Mon Sep 17 00:00:00 2001 From: Jia Liu Date: Fri, 20 Jul 2012 15:50:41 +0800 Subject: target-or32: Add interrupt support Add OpenRISC interrupt support. Signed-off-by: Jia Liu Signed-off-by: Blue Swirl --- cpu-exec.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cpu-exec.c') diff --git a/cpu-exec.c b/cpu-exec.c index bc47114d6d..543460c34c 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -388,6 +388,23 @@ int cpu_exec(CPUArchState *env) do_interrupt(env); next_tb = 0; } +#elif defined(TARGET_OPENRISC) + { + 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) { + env->exception_index = idx; + do_interrupt(env); + next_tb = 0; + } + } #elif defined(TARGET_SPARC) if (interrupt_request & CPU_INTERRUPT_HARD) { if (cpu_interrupts_enabled(env) && -- cgit v1.2.1