Skip to content

Commit

Permalink
target-mips: Move TCG initialization to MIPSCPU initfn
Browse files Browse the repository at this point in the history
Make mips_tcg_init() non-static and add tcg_enabled() check to suppress
it for qtest.

Signed-off-by: Andreas Färber <afaerber@suse.de>
  • Loading branch information
afaerber committed Jan 20, 2013
1 parent c319314 commit 2588ab7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions target-mips/cpu.c
Expand Up @@ -59,6 +59,10 @@ static void mips_cpu_initfn(Object *obj)
CPUMIPSState *env = &cpu->env;

cpu_exec_init(env);

if (tcg_enabled()) {
mips_tcg_init();
}
}

static void mips_cpu_class_init(ObjectClass *c, void *data)
Expand Down
1 change: 1 addition & 0 deletions target-mips/cpu.h
Expand Up @@ -629,6 +629,7 @@ enum {
#define CPU_INTERRUPT_WAKE CPU_INTERRUPT_TGT_INT_0

int cpu_mips_exec(CPUMIPSState *s);
void mips_tcg_init(void);
MIPSCPU *cpu_mips_init(const char *cpu_model);
int cpu_mips_signal_handler(int host_signum, void *pinfo, void *puc);

Expand Down
3 changes: 1 addition & 2 deletions target-mips/translate.c
Expand Up @@ -15791,7 +15791,7 @@ void cpu_dump_state (CPUMIPSState *env, FILE *f, fprintf_function cpu_fprintf,
#endif
}

static void mips_tcg_init(void)
void mips_tcg_init(void)
{
int i;
static int inited;
Expand Down Expand Up @@ -15870,7 +15870,6 @@ MIPSCPU *cpu_mips_init(const char *cpu_model)
#endif
fpu_init(env, def);
mvp_init(env, def);
mips_tcg_init();

object_property_set_bool(OBJECT(cpu), true, "realized", NULL);

Expand Down

0 comments on commit 2588ab7

Please sign in to comment.