[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH next v2 04/74] target-i386: Let cpu_x86_init() retur
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH next v2 04/74] target-i386: Let cpu_x86_init() return X86CPU |
Date: |
Thu, 10 May 2012 02:10:59 +0200 |
Turn cpu_init macro into a static inline function returning CPUX86State
for backwards compatibility.
Signed-off-by: Andreas Färber <address@hidden>
---
target-i386/cpu.h | 12 ++++++++++--
target-i386/helper.c | 4 ++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 4bff61d..adc569c 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -785,7 +785,7 @@ typedef struct CPUX86State {
#include "cpu-qom.h"
-CPUX86State *cpu_x86_init(const char *cpu_model);
+X86CPU *cpu_x86_init(const char *cpu_model);
int cpu_x86_exec(CPUX86State *s);
void x86_cpu_list (FILE *f, fprintf_function cpu_fprintf, const char *optarg);
void x86_cpudef_setup(void);
@@ -958,7 +958,15 @@ uint64_t cpu_get_tsc(CPUX86State *env);
#define TARGET_VIRT_ADDR_SPACE_BITS 32
#endif
-#define cpu_init cpu_x86_init
+static inline CPUX86State *cpu_init(const char *cpu_model)
+{
+ X86CPU *cpu = cpu_x86_init(cpu_model);
+ if (cpu == NULL) {
+ return NULL;
+ }
+ return &cpu->env;
+}
+
#define cpu_exec cpu_x86_exec
#define cpu_gen_code cpu_x86_gen_code
#define cpu_signal_handler cpu_x86_signal_handler
diff --git a/target-i386/helper.c b/target-i386/helper.c
index fe181be..4577cae 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1157,7 +1157,7 @@ int cpu_x86_get_descr_debug(CPUX86State *env, unsigned
int selector,
return 1;
}
-CPUX86State *cpu_x86_init(const char *cpu_model)
+X86CPU *cpu_x86_init(const char *cpu_model)
{
X86CPU *cpu;
CPUX86State *env;
@@ -1183,7 +1183,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
qemu_init_vcpu(env);
- return env;
+ return cpu;
}
#if !defined(CONFIG_USER_ONLY)
--
1.7.7
- [Qemu-devel] [PATCH next v2 00/74] QOM CPUState, part 3: CPU reset, Andreas Färber, 2012/05/09
- [Qemu-devel] [PATCH next v2 04/74] target-i386: Let cpu_x86_init() return X86CPU,
Andreas Färber <=
- [Qemu-devel] [PATCH next v2 03/74] target-i386: Pass X86CPU to do_cpu_{init, sipi}(), Andreas Färber, 2012/05/09
- [Qemu-devel] [PATCH next v2 01/74] target-arm: Use cpu_reset() in cpu_arm_init(), Andreas Färber, 2012/05/09
- [Qemu-devel] [PATCH next v2 02/74] target-mips: Use cpu_reset() in cpu_mips_init(), Andreas Färber, 2012/05/09
- Re: [Qemu-devel] [PATCH next v2 00/74] QOM CPUState, part 3: CPU reset, Andreas Färber, 2012/05/10
- Re: [Qemu-devel] [PATCH next v2 00/74] QOM CPUState, part 3: CPU reset, Peter Maydell, 2012/05/10
- Re: [Qemu-devel] [PATCH next v2 00/74] QOM CPUState, part 3: CPU reset, Max Filippov, 2012/05/14