From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl3NL-0005HI-5T for qemu-devel@nongnu.org; Tue, 18 Dec 2012 15:02:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tl3NH-0000dX-GS for qemu-devel@nongnu.org; Tue, 18 Dec 2012 15:02:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl3NH-0000cJ-8U for qemu-devel@nongnu.org; Tue, 18 Dec 2012 15:02:47 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBIK2kcH010590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 18 Dec 2012 15:02:46 -0500 Received: from blackpad.lan.raisama.net (vpn1-6-125.gru2.redhat.com [10.97.6.125]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qBIK2jjH020083 for ; Tue, 18 Dec 2012 15:02:46 -0500 From: Eduardo Habkost Date: Tue, 18 Dec 2012 18:04:08 -0200 Message-Id: <1355861053-11460-16-git-send-email-ehabkost@redhat.com> In-Reply-To: <1355861053-11460-1-git-send-email-ehabkost@redhat.com> References: <1355861053-11460-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [RFC 15/20] target-arm: replace cpu_arm_init() with generic_cpu_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Eduardo Habkost --- target-arm/cpu.h | 6 ++++-- target-arm/helper.c | 13 ------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 718f1d9..bf50ea1 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -232,7 +232,6 @@ typedef struct CPUARMState { #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 *); @@ -625,7 +624,10 @@ static inline bool cp_access_ok(CPUARMState *env, #define TARGET_PHYS_ADDR_SPACE_BITS 40 #define TARGET_VIRT_ADDR_SPACE_BITS 32 -#define cpu_init(m) CPU(cpu_arm_init(m)) +#define cpu_init(m) generic_cpu_init(TYPE_ARM_CPU, m) + +/* helper for existing code easily create an ARM CPU: */ +#define cpu_arm_init(m) ARM_CPU(cpu_init(m)) #define cpu_exec cpu_arm_exec #define cpu_gen_code cpu_arm_gen_code diff --git a/target-arm/helper.c b/target-arm/helper.c index 2a62a7f..036c056 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1204,19 +1204,6 @@ void register_cp_regs_for_features(ARMCPU *cpu) } } -ARMCPU *cpu_arm_init(const char *cpu_model) -{ - ARMCPU *cpu; - - if (!object_class_by_name(cpu_model)) { - return NULL; - } - cpu = ARM_CPU(object_new(cpu_model)); - CPU(cpu)->cpu_model_str = cpu_model; - cpu_realize(CPU(cpu), NULL); - return cpu; -} - typedef struct ARMCPUListState { fprintf_function cpu_fprintf; FILE *file; -- 1.7.11.7