summaryrefslogtreecommitdiffstats
path: root/cpu-exec.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2014-09-13 09:45:17 -0700
committerPeter Maydell <peter.maydell@linaro.org>2014-09-25 18:54:21 +0100
commit9585db68c78b538e4d835372da3c5675fe0608da (patch)
tree1ec1507aa1e952ff49541ce2e7889b74dc0d9da5 /cpu-exec.c
parent774f0abeae3780db03e2ece61eb712e219b4511d (diff)
downloadhqemu-9585db68c78b538e4d835372da3c5675fe0608da.zip
hqemu-9585db68c78b538e4d835372da3c5675fe0608da.tar.gz
qom: Add cpu_exec_interrupt hook
Continuing the removal of ifdefs from cpu_exec. Cc: Andreas Färber <afaerber@suse.de> Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 1410626734-3804-7-git-send-email-rth@twiddle.net Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'cpu-exec.c')
-rw-r--r--cpu-exec.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index d930e7a..fe313b4 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -676,8 +676,15 @@ int cpu_exec(CPUArchState *env)
next_tb = 0;
}
#endif
- /* Don't use the cached interrupt_request value,
- do_interrupt may have updated the EXITTB flag. */
+ /* The target hook has 3 exit conditions:
+ False when the interrupt isn't processed,
+ True when it is, and we should restart on a new TB,
+ and via longjmp via cpu_loop_exit. */
+ if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
+ next_tb = 0;
+ }
+ /* Don't use the cached interrupt_request value,
+ do_interrupt may have updated the EXITTB flag. */
if (cpu->interrupt_request & CPU_INTERRUPT_EXITTB) {
cpu->interrupt_request &= ~CPU_INTERRUPT_EXITTB;
/* ensure that no TB jump will be modified as
@@ -783,10 +790,7 @@ int cpu_exec(CPUArchState *env)
* local variables as longjmp is marked 'noreturn'. */
cpu = current_cpu;
env = cpu->env_ptr;
-#if !(defined(CONFIG_USER_ONLY) && \
- (defined(TARGET_M68K) || defined(TARGET_PPC) || defined(TARGET_S390X)))
cc = CPU_GET_CLASS(cpu);
-#endif
#ifdef TARGET_I386
x86_cpu = X86_CPU(cpu);
#endif
OpenPOWER on IntegriCloud