]> git.proxmox.com Git - mirror_qemu.git/blobdiff - exec-all.h
qemu-timer: move icount to cpus.c
[mirror_qemu.git] / exec-all.h
index 1120f84661f5aca354c949b0b29353ff7935272d..72ef24679345c73d42c5ec3e6fbe8a36c373c592 100644 (file)
@@ -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