summaryrefslogtreecommitdiff
path: root/include/exec/exec-all.h
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-08-26 05:15:23 +0200
committerAndreas Färber <afaerber@suse.de>2014-03-13 19:20:46 +0100
commit99df7dce8ae81e4a42dac98094ccca3a32dcf8f8 (patch)
tree5dab3291d05db83495f2ce14575ed6604a72762f /include/exec/exec-all.h
parent93afeade09680c657e109bf192dbf70233e4ebbe (diff)
downloadqemu-99df7dce8ae81e4a42dac98094ccca3a32dcf8f8.zip
cpu: Move can_do_io field from CPU_COMMON to CPUState
Rename can_do_io() to cpu_can_do_io() and change argument to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include/exec/exec-all.h')
-rw-r--r--include/exec/exec-all.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index a387922df4..2179329916 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -380,20 +380,25 @@ 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(CPUArchState *env)
+/**
+ * cpu_can_do_io:
+ * @cpu: The CPU for which to check IO.
+ *
+ * Deterministic execution requires that IO only be performed on the last
+ * instruction of a TB so that interrupts take effect immediately.
+ *
+ * Returns: %true if memory-mapped IO is safe, %false otherwise.
+ */
+static inline bool cpu_can_do_io(CPUState *cpu)
{
- CPUState *cpu = ENV_GET_CPU(env);
-
if (!use_icount) {
- return 1;
+ return true;
}
/* If not executing code then assume we are ok. */
if (cpu->current_tb == NULL) {
- return 1;
+ return true;
}
- return env->can_do_io != 0;
+ return cpu->can_do_io != 0;
}
#endif