aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg-op.h
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2018-05-30 18:06:23 -0700
committerRichard Henderson <richard.henderson@linaro.org>2018-06-01 15:15:27 -0700
commit07ea28b41830f946de3841b0ac61a3413679feb9 (patch)
tree42c4837f1a3f06b76291c9cf8412914d2c27c346 /tcg/tcg-op.h
parent392fba9f583223786f844dce9b2e7f9a0ce0147a (diff)
downloadqemu-07ea28b41830f946de3841b0ac61a3413679feb9.zip
qemu-07ea28b41830f946de3841b0ac61a3413679feb9.tar.gz
qemu-07ea28b41830f946de3841b0ac61a3413679feb9.tar.bz2
tcg: Pass tb and index to tcg_gen_exit_tb separately
Do the cast to uintptr_t within the helper, so that the compiler can type check the pointer argument. We can also do some more sanity checking of the index argument. Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/tcg-op.h')
-rw-r--r--tcg/tcg-op.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index 04eb3e9..7513c1e 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -782,10 +782,19 @@ static inline void tcg_gen_insn_start(target_ulong pc, target_ulong a1,
# error "Unhandled number of operands to insn_start"
#endif
-static inline void tcg_gen_exit_tb(uintptr_t val)
-{
- tcg_gen_op1i(INDEX_op_exit_tb, val);
-}
+/**
+ * tcg_gen_exit_tb() - output exit_tb TCG operation
+ * @tb: The TranslationBlock from which we are exiting
+ * @idx: Direct jump slot index, or exit request
+ *
+ * See tcg/README for more info about this TCG operation.
+ * See also tcg.h and the block comment above TB_EXIT_MASK.
+ *
+ * For a normal exit from the TB, back to the main loop, @tb should
+ * be NULL and @idx should be 0. Otherwise, @tb should be valid and
+ * @idx should be one of the TB_EXIT_ values.
+ */
+void tcg_gen_exit_tb(TranslationBlock *tb, unsigned idx);
/**
* tcg_gen_goto_tb() - output goto_tb TCG operation