Skip to content

Commit

Permalink
tcg: Remove argument to tcg_prologue_init
Browse files Browse the repository at this point in the history
We can load tcg_ctx just as easily within the callee.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Oct 3, 2023
1 parent 510859b commit 2507dab
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion accel/tcg/tcg-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static int tcg_init_machine(MachineState *ms)
* There's no guest base to take into account, so go ahead and
* initialize the prologue now.
*/
tcg_prologue_init(tcg_ctx);
tcg_prologue_init();
#endif

return 0;
Expand Down
2 changes: 1 addition & 1 deletion bsd-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ int main(int argc, char **argv)
* generating the prologue until now so that the prologue can take
* the real value of GUEST_BASE into account.
*/
tcg_prologue_init(tcg_ctx);
tcg_prologue_init();

target_cpu_init(env, regs);

Expand Down
2 changes: 1 addition & 1 deletion include/tcg/tcg.h
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ static inline void *tcg_malloc(int size)

void tcg_init(size_t tb_size, int splitwx, unsigned max_cpus);
void tcg_register_thread(void);
void tcg_prologue_init(TCGContext *s);
void tcg_prologue_init(void);
void tcg_func_start(TCGContext *s);

int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start);
Expand Down
2 changes: 1 addition & 1 deletion linux-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ int main(int argc, char **argv, char **envp)
/* Now that we've loaded the binary, GUEST_BASE is fixed. Delay
generating the prologue until now so that the prologue can take
the real value of GUEST_BASE into account. */
tcg_prologue_init(tcg_ctx);
tcg_prologue_init();

target_cpu_copy_regs(env, regs);

Expand Down
3 changes: 2 additions & 1 deletion tcg/tcg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1395,8 +1395,9 @@ TranslationBlock *tcg_tb_alloc(TCGContext *s)
return tb;
}

void tcg_prologue_init(TCGContext *s)
void tcg_prologue_init(void)
{
TCGContext *s = tcg_ctx;
size_t prologue_size;

s->code_ptr = s->code_gen_ptr;
Expand Down

0 comments on commit 2507dab

Please sign in to comment.