diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2023-03-31 10:37:04 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-06-05 12:04:29 -0700 |
commit | d53106c997e5c8e61e37ae9ff9f0e1f243b03968 (patch) | |
tree | 4de92bccaed083434fefc464ac43101dab97d3b4 /include/tcg | |
parent | 0f4e14c25a1900ee77ce29060adbaede1367bd3d (diff) | |
download | qemu-d53106c997e5c8e61e37ae9ff9f0e1f243b03968.zip qemu-d53106c997e5c8e61e37ae9ff9f0e1f243b03968.tar.gz qemu-d53106c997e5c8e61e37ae9ff9f0e1f243b03968.tar.bz2 |
tcg: Pass TCGHelperInfo to tcg_gen_callN
In preparation for compiling tcg/ only once, eliminate
the all_helpers array. Instantiate the info structs for
the generic helpers in accel/tcg/, and the structs for
the target-specific helpers in each translate.c.
Since we don't see all of the info structs at startup,
initialize at first use, using g_once_init_* to make
sure we don't race while doing so.
Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/tcg')
-rw-r--r-- | include/tcg/helper-info.h | 9 | ||||
-rw-r--r-- | include/tcg/tcg.h | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/include/tcg/helper-info.h b/include/tcg/helper-info.h index f65f81c..4b6c9b4 100644 --- a/include/tcg/helper-info.h +++ b/include/tcg/helper-info.h @@ -40,12 +40,17 @@ typedef struct TCGCallArgumentLoc { unsigned tmp_subindex : 2; } TCGCallArgumentLoc; -typedef struct TCGHelperInfo { +struct TCGHelperInfo { void *func; const char *name; + + /* Used with g_once_init_enter. */ #ifdef CONFIG_TCG_INTERPRETER ffi_cif *cif; +#else + uintptr_t init; #endif + unsigned typemask : 32; unsigned flags : 8; unsigned nr_in : 8; @@ -54,6 +59,6 @@ typedef struct TCGHelperInfo { /* Maximum physical arguments are constrained by TCG_TYPE_I128. */ TCGCallArgumentLoc in[MAX_CALL_IARGS * (128 / TCG_TARGET_REG_BITS)]; -} TCGHelperInfo; +}; #endif /* TCG_HELPER_INFO_H */ diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 9b2833b..34035da 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -937,7 +937,7 @@ typedef struct TCGTargetOpDef { bool tcg_op_supported(TCGOpcode op); -void tcg_gen_callN(void *func, TCGTemp *ret, int nargs, TCGTemp **args); +void tcg_gen_callN(TCGHelperInfo *, TCGTemp *ret, int nargs, TCGTemp **args); TCGOp *tcg_emit_op(TCGOpcode opc, unsigned nargs); void tcg_op_remove(TCGContext *s, TCGOp *op); |