From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSqSc-0001rG-Rv for qemu-devel@nongnu.org; Sat, 13 Sep 2014 12:46:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSqSY-0000oj-0c for qemu-devel@nongnu.org; Sat, 13 Sep 2014 12:46:06 -0400 Received: from mail-pd0-x236.google.com ([2607:f8b0:400e:c02::236]:37941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSqSX-0000oZ-Q9 for qemu-devel@nongnu.org; Sat, 13 Sep 2014 12:46:01 -0400 Received: by mail-pd0-f182.google.com with SMTP id w10so3427263pde.13 for ; Sat, 13 Sep 2014 09:46:00 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Sat, 13 Sep 2014 09:45:23 -0700 Message-Id: <1410626734-3804-13-git-send-email-rth@twiddle.net> In-Reply-To: <1410626734-3804-1-git-send-email-rth@twiddle.net> References: <1410626734-3804-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 12/23] target-sh4: Use cpu_exec_interrupt qom hook List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Aurelien Jarno , afaerber@suse.de, aliguori@amazon.com Cc: Aurelien Jarno Signed-off-by: Richard Henderson --- cpu-exec.c | 5 ----- target-sh4/cpu-qom.h | 1 + target-sh4/cpu.c | 1 + target-sh4/helper.c | 9 +++++++++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cpu-exec.c b/cpu-exec.c index 2f73be4..d7f7686 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -592,11 +592,6 @@ int cpu_exec(CPUArchState *env) cc->do_interrupt(cpu); next_tb = 0; } -#elif defined(TARGET_SH4) - if (interrupt_request & CPU_INTERRUPT_HARD) { - cc->do_interrupt(cpu); - next_tb = 0; - } #endif /* The target hook has 3 exit conditions: False when the interrupt isn't processed, diff --git a/target-sh4/cpu-qom.h b/target-sh4/cpu-qom.h index c04e786..6341238 100644 --- a/target-sh4/cpu-qom.h +++ b/target-sh4/cpu-qom.h @@ -84,6 +84,7 @@ static inline SuperHCPU *sh_env_get_cpu(CPUSH4State *env) #define ENV_OFFSET offsetof(SuperHCPU, env) void superh_cpu_do_interrupt(CPUState *cpu); +bool superh_cpu_exec_interrupt(CPUState *cpu, int int_req); void superh_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf, int flags); hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); diff --git a/target-sh4/cpu.c b/target-sh4/cpu.c index e7f0521..d187a2b 100644 --- a/target-sh4/cpu.c +++ b/target-sh4/cpu.c @@ -276,6 +276,7 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = superh_cpu_class_by_name; cc->has_work = superh_cpu_has_work; cc->do_interrupt = superh_cpu_do_interrupt; + cc->cpu_exec_interrupt = superh_cpu_exec_interrupt; cc->dump_state = superh_cpu_dump_state; cc->set_pc = superh_cpu_set_pc; cc->synchronize_from_tb = superh_cpu_synchronize_from_tb; diff --git a/target-sh4/helper.c b/target-sh4/helper.c index 9ebdd5c..5811360 100644 --- a/target-sh4/helper.c +++ b/target-sh4/helper.c @@ -863,3 +863,12 @@ int cpu_sh4_is_cached(CPUSH4State * env, target_ulong addr) } #endif + +bool superh_cpu_exec_interrupt(CPUState *cs, int interrupt_request) +{ + if (interrupt_request & CPU_INTERRUPT_HARD) { + superh_cpu_do_interrupt(cs); + return true; + } + return false; +} -- 1.9.3