accel/tcg: Pass max_insn to gen_intermediate_code by pointer
In preparation for returning the number of insns generated via the same pointer. Adjust only the prototypes so far. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
0ef3d7045b
commit
597f9b2d30
@ -280,7 +280,7 @@ static int setjmp_gen_code(CPUArchState *env, TranslationBlock *tb,
|
||||
tcg_func_start(tcg_ctx);
|
||||
|
||||
tcg_ctx->cpu = env_cpu(env);
|
||||
gen_intermediate_code(env_cpu(env), tb, *max_insns, pc, host_pc);
|
||||
gen_intermediate_code(env_cpu(env), tb, max_insns, pc, host_pc);
|
||||
assert(tb->size != 0);
|
||||
tcg_ctx->cpu = NULL;
|
||||
*max_insns = tb->icount;
|
||||
|
@ -42,7 +42,7 @@ bool translator_use_goto_tb(DisasContextBase *db, target_ulong dest)
|
||||
return ((db->pc_first ^ dest) & TARGET_PAGE_MASK) == 0;
|
||||
}
|
||||
|
||||
void translator_loop(CPUState *cpu, TranslationBlock *tb, int max_insns,
|
||||
void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc,
|
||||
const TranslatorOps *ops, DisasContextBase *db)
|
||||
{
|
||||
@ -55,7 +55,7 @@ void translator_loop(CPUState *cpu, TranslationBlock *tb, int max_insns,
|
||||
db->pc_next = pc;
|
||||
db->is_jmp = DISAS_NEXT;
|
||||
db->num_insns = 0;
|
||||
db->max_insns = max_insns;
|
||||
db->max_insns = *max_insns;
|
||||
db->singlestep_enabled = cflags & CF_SINGLE_STEP;
|
||||
db->host_addr[0] = host_pc;
|
||||
db->host_addr[1] = NULL;
|
||||
|
@ -37,7 +37,7 @@
|
||||
* This function must be provided by the target, which should create
|
||||
* the target-specific DisasContext, and then invoke translator_loop.
|
||||
*/
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc);
|
||||
|
||||
/**
|
||||
@ -146,7 +146,7 @@ typedef struct TranslatorOps {
|
||||
* - When single-stepping is enabled (system-wide or on the current vCPU).
|
||||
* - When too many instructions have been translated.
|
||||
*/
|
||||
void translator_loop(CPUState *cpu, TranslationBlock *tb, int max_insns,
|
||||
void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc,
|
||||
const TranslatorOps *ops, DisasContextBase *db);
|
||||
|
||||
|
@ -3043,7 +3043,7 @@ static const TranslatorOps alpha_tr_ops = {
|
||||
.disas_log = alpha_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext dc;
|
||||
|
@ -9970,7 +9970,7 @@ static const TranslatorOps thumb_translator_ops = {
|
||||
};
|
||||
|
||||
/* generate intermediate code for basic block 'tb'. */
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext dc = { };
|
||||
|
@ -3049,7 +3049,7 @@ static const TranslatorOps avr_tr_ops = {
|
||||
.disas_log = avr_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext dc = { };
|
||||
|
@ -3286,7 +3286,7 @@ static const TranslatorOps cris_tr_ops = {
|
||||
.disas_log = cris_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext dc;
|
||||
|
@ -962,7 +962,7 @@ static const TranslatorOps hexagon_tr_ops = {
|
||||
.disas_log = hexagon_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext ctx;
|
||||
|
@ -4359,7 +4359,7 @@ static const TranslatorOps hppa_tr_ops = {
|
||||
.disas_log = hppa_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext ctx;
|
||||
|
@ -7158,7 +7158,7 @@ static const TranslatorOps i386_tr_ops = {
|
||||
};
|
||||
|
||||
/* generate intermediate code for basic block 'tb'. */
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext dc;
|
||||
|
@ -245,7 +245,7 @@ static const TranslatorOps loongarch_tr_ops = {
|
||||
.disas_log = loongarch_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext ctx;
|
||||
|
@ -6393,7 +6393,7 @@ static const TranslatorOps m68k_tr_ops = {
|
||||
.disas_log = m68k_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext dc;
|
||||
|
@ -1849,7 +1849,7 @@ static const TranslatorOps mb_tr_ops = {
|
||||
.disas_log = mb_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext dc;
|
||||
|
@ -16159,7 +16159,7 @@ static const TranslatorOps mips_tr_ops = {
|
||||
.disas_log = mips_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext ctx;
|
||||
|
@ -1037,7 +1037,7 @@ static const TranslatorOps nios2_tr_ops = {
|
||||
.disas_log = nios2_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext dc;
|
||||
|
@ -1705,7 +1705,7 @@ static const TranslatorOps openrisc_tr_ops = {
|
||||
.disas_log = openrisc_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext ctx;
|
||||
|
@ -7707,7 +7707,7 @@ static const TranslatorOps ppc_tr_ops = {
|
||||
.disas_log = ppc_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext ctx;
|
||||
|
@ -1309,7 +1309,7 @@ static const TranslatorOps riscv_tr_ops = {
|
||||
.disas_log = riscv_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext ctx;
|
||||
|
@ -2363,7 +2363,7 @@ static const TranslatorOps rx_tr_ops = {
|
||||
.disas_log = rx_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext dc;
|
||||
|
@ -6619,7 +6619,7 @@ static const TranslatorOps s390x_tr_ops = {
|
||||
.disas_log = s390x_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext dc;
|
||||
|
@ -2374,7 +2374,7 @@ static const TranslatorOps sh4_tr_ops = {
|
||||
.disas_log = sh4_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext ctx;
|
||||
|
@ -5904,7 +5904,7 @@ static const TranslatorOps sparc_tr_ops = {
|
||||
.disas_log = sparc_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext dc = {};
|
||||
|
@ -8881,7 +8881,7 @@ static const TranslatorOps tricore_tr_ops = {
|
||||
};
|
||||
|
||||
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext ctx;
|
||||
|
@ -1279,7 +1279,7 @@ static const TranslatorOps xtensa_translator_ops = {
|
||||
.disas_log = xtensa_tr_disas_log,
|
||||
};
|
||||
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_insns,
|
||||
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int *max_insns,
|
||||
target_ulong pc, void *host_pc)
|
||||
{
|
||||
DisasContext dc = {};
|
||||
|
Loading…
Reference in New Issue
Block a user