summaryrefslogtreecommitdiffstats
path: root/exec-all.h
diff options
context:
space:
mode:
authorAnthony Liguori2011-10-24 17:51:12 +0200
committerAnthony Liguori2011-10-24 17:51:12 +0200
commit952e849c150b4f1b89f8728cba00f925c1d6e75b (patch)
tree93e950b81e84d1d20a915d8b1da5c75d3911f553 /exec-all.h
parentAdd stdio char device on windows (diff)
parentsimplify main loop functions (diff)
downloadqemu-952e849c150b4f1b89f8728cba00f925c1d6e75b.tar.gz
qemu-952e849c150b4f1b89f8728cba00f925c1d6e75b.tar.xz
qemu-952e849c150b4f1b89f8728cba00f925c1d6e75b.zip
Merge remote-tracking branch 'bonzini/split-main-loop-for-anthony' into staging
Diffstat (limited to 'exec-all.h')
-rw-r--r--exec-all.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/exec-all.h b/exec-all.h
index 1120f84661..72ef246793 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -356,4 +356,18 @@ extern int singlestep;
/* cpu-exec.c */
extern volatile sig_atomic_t exit_request;
+/* Deterministic execution requires that IO only be performed on the last
+ instruction of a TB so that interrupts take effect immediately. */
+static inline int can_do_io(CPUState *env)
+{
+ if (!use_icount) {
+ return 1;
+ }
+ /* If not executing code then assume we are ok. */
+ if (!env->current_tb) {
+ return 1;
+ }
+ return env->can_do_io != 0;
+}
+
#endif