aboutsummaryrefslogtreecommitdiff
path: root/target-microblaze/translate.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-05-05 12:14:03 +0200
committerAndreas Färber <afaerber@suse.de>2012-06-04 23:00:42 +0200
commitb33ab1f7a965a9765dc9a5b9f061c44eee2e25e2 (patch)
tree3521cb88060005c81c9b4a609bcd5c44741c5a36 /target-microblaze/translate.c
parent1584aafd02b949d6fa554e93bd70e5940217b66c (diff)
target-microblaze: Let cpu_mb_init() return MicroBlazeCPU
Since qemu_init_vcpu() is no-op for CONFIG_USER_ONLY drop the env variable that is now unused there. Turn cpu_init macro into a static inline function returning CPUMBState for backwards compatibility. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'target-microblaze/translate.c')
-rw-r--r--target-microblaze/translate.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index f0ebd596c0..3c2936f1b1 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -1951,21 +1951,20 @@ void cpu_dump_state (CPUMBState *env, FILE *f, fprintf_function cpu_fprintf,
cpu_fprintf(f, "\n\n");
}
-CPUMBState *cpu_mb_init (const char *cpu_model)
+MicroBlazeCPU *cpu_mb_init(const char *cpu_model)
{
MicroBlazeCPU *cpu;
- CPUMBState *env;
static int tcg_initialized = 0;
int i;
cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
- env = &cpu->env;
cpu_reset(CPU(cpu));
- qemu_init_vcpu(env);
+ qemu_init_vcpu(&cpu->env);
- if (tcg_initialized)
- return env;
+ if (tcg_initialized) {
+ return cpu;
+ }
tcg_initialized = 1;
@@ -1999,7 +1998,7 @@ CPUMBState *cpu_mb_init (const char *cpu_model)
#define GEN_HELPER 2
#include "helper.h"
- return env;
+ return cpu;
}
void cpu_state_reset(CPUMBState *env)