[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/74] target-cris: Let cpu_cris_init() return CRISC
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH 18/74] target-cris: Let cpu_cris_init() return CRISCPU |
Date: |
Tue, 5 Jun 2012 03:21:50 +0200 |
Turn cpu_init macro into a static inline function returning CPUCRISState
for backwards compatibility.
Signed-off-by: Andreas Färber <address@hidden>
Acked-by: Edgar E. Iglesias <address@hidden>
---
target-cris/cpu.h | 12 ++++++++++--
target-cris/translate.c | 8 ++++----
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/target-cris/cpu.h b/target-cris/cpu.h
index 5449cc4..a760367 100644
--- a/target-cris/cpu.h
+++ b/target-cris/cpu.h
@@ -171,7 +171,7 @@ typedef struct CPUCRISState {
#include "cpu-qom.h"
-CPUCRISState *cpu_cris_init(const char *cpu_model);
+CRISCPU *cpu_cris_init(const char *cpu_model);
int cpu_cris_exec(CPUCRISState *s);
void cpu_cris_close(CPUCRISState *s);
void do_interrupt(CPUCRISState *env);
@@ -216,7 +216,15 @@ enum {
#define TARGET_PHYS_ADDR_SPACE_BITS 32
#define TARGET_VIRT_ADDR_SPACE_BITS 32
-#define cpu_init cpu_cris_init
+static inline CPUCRISState *cpu_init(const char *cpu_model)
+{
+ CRISCPU *cpu = cpu_cris_init(cpu_model);
+ if (cpu == NULL) {
+ return NULL;
+ }
+ return &cpu->env;
+}
+
#define cpu_exec cpu_cris_exec
#define cpu_gen_code cpu_cris_gen_code
#define cpu_signal_handler cpu_cris_signal_handler
diff --git a/target-cris/translate.c b/target-cris/translate.c
index a398057..eed03d3 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -3503,7 +3503,7 @@ static uint32_t vr_by_name(const char *name)
return 32;
}
-CPUCRISState *cpu_cris_init (const char *cpu_model)
+CRISCPU *cpu_cris_init(const char *cpu_model)
{
CRISCPU *cpu;
CPUCRISState *env;
@@ -3519,7 +3519,7 @@ CPUCRISState *cpu_cris_init (const char *cpu_model)
qemu_init_vcpu(env);
if (tcg_initialized) {
- return env;
+ return cpu;
}
tcg_initialized = 1;
@@ -3529,7 +3529,7 @@ CPUCRISState *cpu_cris_init (const char *cpu_model)
if (env->pregs[PR_VR] < 32) {
cpu_crisv10_init(env);
- return env;
+ return cpu;
}
@@ -3573,7 +3573,7 @@ CPUCRISState *cpu_cris_init (const char *cpu_model)
pregnames[i]);
}
- return env;
+ return cpu;
}
void cpu_state_reset(CPUCRISState *env)
--
1.7.7
- [Qemu-devel] [PATCH 12/74] target-xtensa: Let cpu_xtensa_init() return XtensaCPU, (continued)
- [Qemu-devel] [PATCH 12/74] target-xtensa: Let cpu_xtensa_init() return XtensaCPU, Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 15/74] xtensa_lx60: Use cpu_xtensa_init() to obtain XtensaCPU, Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 14/74] xtensa_sim: Pass XtensaCPU to sim_reset(), Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 19/74] axis_dev88: Use cpu_cris_init() to obtain CRISCPU, Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 13/74] xtensa_sim: Use cpu_xtensa_init() to obtain XtensaCPU, Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 16/74] xtensa_lx60: Pass XtensaCPU to lx60_reset(), Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 23/74] petalogix_ml605: Use cpu_mb_init() to obtain MicroBlazeCPU, Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 17/74] target-cris: Reindent cpu_cris_init(), Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 21/74] cris-boot: Pass CRISCPU to main_cpu_reset()., Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 20/74] cris-boot: Pass CRISCPU to cris_load_image(), Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 18/74] target-cris: Let cpu_cris_init() return CRISCPU,
Andreas Färber <=
- [Qemu-devel] [PATCH 22/74] target-microblaze: Let cpu_mb_init() return MicroBlazeCPU, Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 25/74] microblaze_boot: Pass MicroBlazeCPU to microblaze_load_kernel(), Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 24/74] petalogix_s3adsp1800_mmu: Use cpu_mb_init() to obtain MicroBlazeCPU, Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 26/74] target-i386: Pass X86CPU to do_cpu_{init, sipi}(), Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 30/74] target-sh4: Let cpu_sh4_init() return SuperHCPU, Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 28/74] pc: Use cpu_x86_init() to obtain X86CPU, Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 27/74] target-i386: Let cpu_x86_init() return X86CPU, Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 31/74] r2d: Use cpu_sh4_init() to obtain SuperHCPU, Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 41/74] mips_malta: Pass MIPSCPU to main_cpu_reset(), Andreas Färber, 2012/06/04
- [Qemu-devel] [PATCH 32/74] r2d: Store SuperHCPU in ResetData, Andreas Färber, 2012/06/04