aboutsummaryrefslogtreecommitdiff
path: root/include/tcg
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2025-01-16 22:31:32 +0100
committerRichard Henderson <richard.henderson@linaro.org>2025-01-17 08:24:43 -0800
commitd3203d5a0cff5a7064fe52b99510835e6b7eb03b (patch)
tree2744b6fd941933405bb19fecd2cb4ccd59546125 /include/tcg
parent8095f652f237df90b7b01e025cbcebe95065541c (diff)
downloadqemu-d3203d5a0cff5a7064fe52b99510835e6b7eb03b.zip
qemu-d3203d5a0cff5a7064fe52b99510835e6b7eb03b.tar.gz
qemu-d3203d5a0cff5a7064fe52b99510835e6b7eb03b.tar.bz2
tcg: Document tb_lookup() and tcg_tb_lookup()
These similarly named functions serve different purposes; add docstrings to highlight them. Suggested-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20250116213214.5695-1-iii@linux.ibm.com>
Diffstat (limited to 'include/tcg')
-rw-r--r--include/tcg/tcg.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index e7ddf97..1d1d668 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -638,10 +638,51 @@ void tcg_region_reset_all(void);
size_t tcg_code_size(void);
size_t tcg_code_capacity(void);
+/**
+ * tcg_tb_insert:
+ * @tb: translation block to insert
+ *
+ * Insert @tb into the region trees.
+ */
void tcg_tb_insert(TranslationBlock *tb);
+
+/**
+ * tcg_tb_remove:
+ * @tb: translation block to remove
+ *
+ * Remove @tb from the region trees.
+ */
void tcg_tb_remove(TranslationBlock *tb);
+
+/**
+ * tcg_tb_lookup:
+ * @tc_ptr: host PC to look up
+ *
+ * Look up a translation block inside the region trees by @tc_ptr. This is
+ * useful for exception handling, but must not be used for the purposes of
+ * executing the returned translation block. See struct tb_tc for more
+ * information.
+ *
+ * Returns: a translation block previously inserted into the region trees,
+ * such that @tc_ptr points anywhere inside the code generated for it, or
+ * NULL.
+ */
TranslationBlock *tcg_tb_lookup(uintptr_t tc_ptr);
+
+/**
+ * tcg_tb_foreach:
+ * @func: callback
+ * @user_data: opaque value to pass to @callback
+ *
+ * Call @func for each translation block inserted into the region trees.
+ */
void tcg_tb_foreach(GTraverseFunc func, gpointer user_data);
+
+/**
+ * tcg_nb_tbs:
+ *
+ * Returns: the number of translation blocks inserted into the region trees.
+ */
size_t tcg_nb_tbs(void);
/* user-mode: Called with mmap_lock held. */