Revision d1a94fec
b/target-cris/cpu.c | ||
---|---|---|
70 | 70 |
{ |
71 | 71 |
CRISCPU *cpu = CRIS_CPU(obj); |
72 | 72 |
CPUCRISState *env = &cpu->env; |
73 |
static bool tcg_initialized; |
|
73 | 74 |
|
74 | 75 |
cpu_exec_init(env); |
76 |
|
|
77 |
if (tcg_enabled() && !tcg_initialized) { |
|
78 |
tcg_initialized = true; |
|
79 |
if (env->pregs[PR_VR] < 32) { |
|
80 |
cris_initialize_crisv10_tcg(); |
|
81 |
} else { |
|
82 |
cris_initialize_tcg(); |
|
83 |
} |
|
84 |
} |
|
75 | 85 |
} |
76 | 86 |
|
77 | 87 |
static void cris_cpu_class_init(ObjectClass *oc, void *data) |
b/target-cris/cpu.h | ||
---|---|---|
182 | 182 |
int cpu_cris_signal_handler(int host_signum, void *pinfo, |
183 | 183 |
void *puc); |
184 | 184 |
|
185 |
void cris_initialize_tcg(void); |
|
186 |
void cris_initialize_crisv10_tcg(void); |
|
187 |
|
|
185 | 188 |
enum { |
186 | 189 |
CC_OP_DYNAMIC, /* Use env->cc_op */ |
187 | 190 |
CC_OP_FLAGS, |
b/target-cris/translate.c | ||
---|---|---|
3550 | 3550 |
{ |
3551 | 3551 |
CRISCPU *cpu; |
3552 | 3552 |
CPUCRISState *env; |
3553 |
static int tcg_initialized = 0; |
|
3554 |
int i; |
|
3555 | 3553 |
|
3556 | 3554 |
cpu = CRIS_CPU(object_new(TYPE_CRIS_CPU)); |
3557 | 3555 |
env = &cpu->env; |
... | ... | |
3560 | 3558 |
|
3561 | 3559 |
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); |
3562 | 3560 |
|
3563 |
if (tcg_initialized) { |
|
3564 |
return cpu; |
|
3565 |
} |
|
3561 |
return cpu; |
|
3562 |
} |
|
3566 | 3563 |
|
3567 |
tcg_initialized = 1; |
|
3564 |
void cris_initialize_tcg(void) |
|
3565 |
{ |
|
3566 |
int i; |
|
3568 | 3567 |
|
3569 | 3568 |
#define GEN_HELPER 2 |
3570 | 3569 |
#include "helper.h" |
3571 | 3570 |
|
3572 |
if (env->pregs[PR_VR] < 32) { |
|
3573 |
cpu_crisv10_init(env); |
|
3574 |
return cpu; |
|
3575 |
} |
|
3576 |
|
|
3577 |
|
|
3578 | 3571 |
cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env"); |
3579 | 3572 |
cc_x = tcg_global_mem_new(TCG_AREG0, |
3580 | 3573 |
offsetof(CPUCRISState, cc_x), "cc_x"); |
... | ... | |
3614 | 3607 |
offsetof(CPUCRISState, pregs[i]), |
3615 | 3608 |
pregnames[i]); |
3616 | 3609 |
} |
3617 |
|
|
3618 |
return cpu; |
|
3619 | 3610 |
} |
3620 | 3611 |
|
3621 | 3612 |
void restore_state_to_opc(CPUCRISState *env, TranslationBlock *tb, int pc_pos) |
b/target-cris/translate_v10.c | ||
---|---|---|
1257 | 1257 |
return insn_len; |
1258 | 1258 |
} |
1259 | 1259 |
|
1260 |
static CPUCRISState *cpu_crisv10_init (CPUCRISState *env)
|
|
1260 |
void cris_initialize_crisv10_tcg(void)
|
|
1261 | 1261 |
{ |
1262 | 1262 |
int i; |
1263 | 1263 |
|
... | ... | |
1300 | 1300 |
offsetof(CPUCRISState, pregs[i]), |
1301 | 1301 |
pregnames_v10[i]); |
1302 | 1302 |
} |
1303 |
|
|
1304 |
return env; |
|
1305 | 1303 |
} |
1306 |
|
Also available in: Unified diff