From 778c3a0619f3b47f94e566ca4f656aabe5f4b3d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 20 Apr 2012 07:39:14 +0000 Subject: target-arm: Change cpu_arm_init() return type to ARMCPU MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make cpu_arm_init() return a QOM ARMCPU, so that we don't need to obtain an ARMCPU through arm_env_get_cpu() in machine init code. This requires to adjust the inclusion site of cpu-qom.h and in turn, forward-looking, to homogenize its include order. cpu_init() must still return a CPUARMState for backwards and cross-target compatibility, so adjust the cpu_init macro. Signed-off-by: Andreas Färber Signed-off-by: Peter Maydell --- target-arm/cpu.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'target-arm/cpu.h') diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 01e0e36c2f..5eac070379 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -238,7 +238,9 @@ typedef struct CPUARMState { const struct arm_boot_info *boot_info; } CPUARMState; -CPUARMState *cpu_arm_init(const char *cpu_model); +#include "cpu-qom.h" + +ARMCPU *cpu_arm_init(const char *cpu_model); void arm_translate_init(void); int cpu_arm_exec(CPUARMState *s); void do_interrupt(CPUARMState *); @@ -456,7 +458,7 @@ void cpu_arm_set_cp_io(CPUARMState *env, int cpnum, #define TARGET_PHYS_ADDR_SPACE_BITS 32 #define TARGET_VIRT_ADDR_SPACE_BITS 32 -#define cpu_init cpu_arm_init +#define cpu_init(model) (&cpu_arm_init(model)->env) #define cpu_exec cpu_arm_exec #define cpu_gen_code cpu_arm_gen_code #define cpu_signal_handler cpu_arm_signal_handler @@ -483,7 +485,6 @@ static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) #endif #include "cpu-all.h" -#include "cpu-qom.h" /* Bit usage in the TB flags field: */ #define ARM_TBFLAG_THUMB_SHIFT 0 -- cgit v1.2.3