aboutsummaryrefslogtreecommitdiff
path: root/target-microblaze/translate.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-01-20 01:10:52 +0100
committerAndreas Färber <afaerber@suse.de>2013-02-16 14:50:58 +0100
commitcd0c24f9095b1f825210bb9d9f99532c78668074 (patch)
tree7c7828d4a1946c57f0134b66f84ab14dd9011703 /target-microblaze/translate.c
parent1cc896195bae54d7a5f48f9032037d8f6f65abd5 (diff)
downloadqemu-arm-cd0c24f9095b1f825210bb9d9f99532c78668074.tar.gz
target-microblaze: Move TCG initialization to MicroBlazeCPU initfn
Split off TCG initialization from cpu_mb_init() into mb_tcg_init() to call it from the initfn. Ensures that a QOM-created MicroBlazeCPU is usable. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-microblaze/translate.c')
-rw-r--r--target-microblaze/translate.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index a84856ba43..12ea820522 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -1965,18 +1965,17 @@ void cpu_dump_state (CPUMBState *env, FILE *f, fprintf_function cpu_fprintf,
MicroBlazeCPU *cpu_mb_init(const char *cpu_model)
{
MicroBlazeCPU *cpu;
- static int tcg_initialized = 0;
- int i;
cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
- if (tcg_initialized) {
- return cpu;
- }
+ return cpu;
+}
- tcg_initialized = 1;
+void mb_tcg_init(void)
+{
+ int i;
cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env");
@@ -2007,8 +2006,6 @@ MicroBlazeCPU *cpu_mb_init(const char *cpu_model)
}
#define GEN_HELPER 2
#include "helper.h"
-
- return cpu;
}
void restore_state_to_opc(CPUMBState *env, TranslationBlock *tb, int pc_pos)