aboutsummaryrefslogtreecommitdiff
path: root/target-microblaze/cpu.h
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/cpu.h
parent1584aafd02b949d6fa554e93bd70e5940217b66c (diff)
downloadqemu-b33ab1f7a965a9765dc9a5b9f061c44eee2e25e2.zip
qemu-b33ab1f7a965a9765dc9a5b9f061c44eee2e25e2.tar.gz
qemu-b33ab1f7a965a9765dc9a5b9f061c44eee2e25e2.tar.bz2
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/cpu.h')
-rw-r--r--target-microblaze/cpu.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index b0ba9fe..4968c24 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -272,7 +272,7 @@ struct CPUMBState {
#include "cpu-qom.h"
-CPUMBState *cpu_mb_init(const char *cpu_model);
+MicroBlazeCPU *cpu_mb_init(const char *cpu_model);
int cpu_mb_exec(CPUMBState *s);
void cpu_mb_close(CPUMBState *s);
void do_interrupt(CPUMBState *env);
@@ -295,7 +295,15 @@ enum {
#define TARGET_PHYS_ADDR_SPACE_BITS 32
#define TARGET_VIRT_ADDR_SPACE_BITS 32
-#define cpu_init cpu_mb_init
+static inline CPUMBState *cpu_init(const char *cpu_model)
+{
+ MicroBlazeCPU *cpu = cpu_mb_init(cpu_model);
+ if (cpu == NULL) {
+ return NULL;
+ }
+ return &cpu->env;
+}
+
#define cpu_exec cpu_mb_exec
#define cpu_gen_code cpu_mb_gen_code
#define cpu_signal_handler cpu_mb_signal_handler