aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg-internal.h
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-03-18 11:29:50 -0600
committerRichard Henderson <richard.henderson@linaro.org>2021-06-19 08:51:11 -0700
commit3e92aa34434bbcf88e5cc0a8334946216dcaf233 (patch)
treecc715c8ab79d9791687eae646674af40edd7b4da /tcg/tcg-internal.h
parent9d87e59585784cbc6a3307a00d1493268e0daead (diff)
downloadqemu-3e92aa34434bbcf88e5cc0a8334946216dcaf233.zip
qemu-3e92aa34434bbcf88e5cc0a8334946216dcaf233.tar.gz
qemu-3e92aa34434bbcf88e5cc0a8334946216dcaf233.tar.bz2
tcg: Store the TCGHelperInfo in the TCGOp for call
This will give us both flags and typemask for use later. We also fix a dumping bug, wherein calls generated for plugins fail tcg_find_helper and print (null) instead of either a name or the raw function pointer. Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/tcg-internal.h')
-rw-r--r--tcg/tcg-internal.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/tcg/tcg-internal.h b/tcg/tcg-internal.h
index 0796407..6ab8910 100644
--- a/tcg/tcg-internal.h
+++ b/tcg/tcg-internal.h
@@ -27,6 +27,13 @@
#define TCG_HIGHWATER 1024
+typedef struct TCGHelperInfo {
+ void *func;
+ const char *name;
+ unsigned flags;
+ unsigned typemask;
+} TCGHelperInfo;
+
extern TCGContext tcg_init_ctx;
extern TCGContext **tcg_ctxs;
extern unsigned int tcg_cur_ctxs;
@@ -37,9 +44,14 @@ bool tcg_region_alloc(TCGContext *s);
void tcg_region_initial_alloc(TCGContext *s);
void tcg_region_prologue_set(TCGContext *s);
+static inline const TCGHelperInfo *tcg_call_info(TCGOp *op)
+{
+ return (void *)(uintptr_t)op->args[TCGOP_CALLO(op) + TCGOP_CALLI(op) + 1];
+}
+
static inline unsigned tcg_call_flags(TCGOp *op)
{
- return op->args[TCGOP_CALLO(op) + TCGOP_CALLI(op) + 1];
+ return tcg_call_info(op)->flags;
}
#endif /* TCG_INTERNAL_H */