Received: from eggs.gnu.org ([2001:4830:134:3::10]:38305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVOnY-0005Rk-3I for qemu-devel@nongnu.org; Tue, 10 Mar 2015 14:22:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVOnQ-0002fT-6b for qemu-devel@nongnu.org; Tue, 10 Mar 2015 14:22:32 -0400 Received: from cantor2.suse.de ([195.135.220.15]:55114 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVOnP-0002fH-W2 for qemu-devel@nongnu.org; Tue, 10 Mar 2015 14:22:24 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 10 Mar 2015 19:22:17 +0100 Message-Id: <1426011740-17688-4-git-send-email-afaerber@suse.de> In-Reply-To: <1426011740-17688-1-git-send-email-afaerber@suse.de> References: <1426011740-17688-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 3/6] target-unicore32: Make uc32_cpu_init() return UniCore32CPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Guan Xuetao , Eduardo Habkost , =?UTF-8?q?Andreas=20F=C3=A4rber?= From: Eduardo Habkost This way, the cpu_init() function in target-unicore32 will follow the same pattern used on all other architectures. Signed-off-by: Eduardo Habkost Signed-off-by: Andreas F=C3=A4rber --- target-unicore32/cpu.h | 14 ++++++++++++-- target-unicore32/helper.c | 10 ++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/target-unicore32/cpu.h b/target-unicore32/cpu.h index 50972f9..11d76dc 100644 --- a/target-unicore32/cpu.h +++ b/target-unicore32/cpu.h @@ -122,11 +122,9 @@ void cpu_asr_write(CPUUniCore32State *env1, target_u= long val, target_ulong mask) #define UC32_HWCAP_CMOV 4 /* 1 << 2 */ #define UC32_HWCAP_UCF64 8 /* 1 << 3 */ =20 -#define cpu_init uc32_cpu_init #define cpu_exec uc32_cpu_exec #define cpu_signal_handler uc32_cpu_signal_handler =20 -CPUUniCore32State *uc32_cpu_init(const char *cpu_model); int uc32_cpu_exec(CPUUniCore32State *s); int uc32_cpu_signal_handler(int host_signum, void *pinfo, void *puc); =20 @@ -143,6 +141,18 @@ static inline int cpu_mmu_index(CPUUniCore32State *e= nv) #include "cpu-qom.h" #include "exec/exec-all.h" =20 +UniCore32CPU *uc32_cpu_init(const char *cpu_model); + +static inline CPUUniCore32State *cpu_init(const char *cpu_model) +{ + UniCore32CPU *cpu =3D uc32_cpu_init(cpu_model); + if (cpu =3D=3D NULL) { + return NULL; + } + return &cpu->env; + +} + static inline void cpu_get_tb_cpu_state(CPUUniCore32State *env, target_u= long *pc, target_ulong *cs_base, int *flag= s) { diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c index b4654fa..ae63277 100644 --- a/target-unicore32/helper.c +++ b/target-unicore32/helper.c @@ -25,15 +25,9 @@ #define DPRINTF(fmt, ...) do {} while (0) #endif =20 -CPUUniCore32State *uc32_cpu_init(const char *cpu_model) +UniCore32CPU *uc32_cpu_init(const char *cpu_model) { - UniCore32CPU *cpu; - - cpu =3D UNICORE32_CPU(cpu_generic_init(TYPE_UNICORE32_CPU, cpu_model= )); - if (cpu =3D=3D NULL) { - return NULL; - } - return &cpu->env; + return UNICORE32_CPU(cpu_generic_init(TYPE_UNICORE32_CPU, cpu_model)= ); } =20 uint32_t HELPER(clo)(uint32_t x) --=20 2.1.4