From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl3NP-0005Rs-Dn for qemu-devel@nongnu.org; Tue, 18 Dec 2012 15:02:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tl3NH-0000dJ-AW for qemu-devel@nongnu.org; Tue, 18 Dec 2012 15:02:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16291) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl3NH-0000cG-0z for qemu-devel@nongnu.org; Tue, 18 Dec 2012 15:02:47 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBIK2ktw027049 (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-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qBIK2jlr024007 for ; Tue, 18 Dec 2012 15:02:46 -0500 From: Eduardo Habkost Date: Tue, 18 Dec 2012 18:04:06 -0200 Message-Id: <1355861053-11460-14-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 13/20] target-openrisc: replace cpu_openrisc_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 --- hw/openrisc_sim.c | 2 +- target-openrisc/cpu.c | 22 ---------------------- target-openrisc/cpu.h | 4 +--- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/hw/openrisc_sim.c b/hw/openrisc_sim.c index 440dc9e..1955854 100644 --- a/hw/openrisc_sim.c +++ b/hw/openrisc_sim.c @@ -105,7 +105,7 @@ static void openrisc_sim_init(QEMUMachineInitArgs *args) } for (n = 0; n < smp_cpus; n++) { - cpu = cpu_openrisc_init(cpu_model); + cpu = OPENRISC_CPU(generic_cpu_init(TYPE_OPENRISC_CPU, cpu_model)); if (cpu == NULL) { qemu_log("Unable to find CPU defineition!\n"); exit(1); diff --git a/target-openrisc/cpu.c b/target-openrisc/cpu.c index 0a8253e..1ec4e2a 100644 --- a/target-openrisc/cpu.c +++ b/target-openrisc/cpu.c @@ -157,28 +157,6 @@ static void openrisc_cpu_register_types(void) } } -OpenRISCCPU *cpu_openrisc_init(const char *cpu_model) -{ - OpenRISCCPU *cpu; - Error *err = NULL; - - if (!object_class_by_name(cpu_model)) { - return NULL; - } - cpu = OPENRISC_CPU(object_new(cpu_model)); - CPU(cpu)->cpu_model_str = cpu_model; - - cpu_realize(CPU(cpu), &err); - if (err) { - goto error; - } - - return cpu; -error: - error_report("cpu_openrisc_init: %s", error_get_pretty(err)); - return NULL; -} - typedef struct OpenRISCCPUList { fprintf_function cpu_fprintf; FILE *file; diff --git a/target-openrisc/cpu.h b/target-openrisc/cpu.h index d0a2fdc..e6b3bfa 100644 --- a/target-openrisc/cpu.h +++ b/target-openrisc/cpu.h @@ -346,8 +346,6 @@ static inline CPUOpenRISCState *openrisc_cpu_get_env(OpenRISCCPU *cpu) #define CPU_GET_ENV(cpu) openrisc_cpu_get_env(OPENRISC_CPU(cpu)) -OpenRISCCPU *cpu_openrisc_init(const char *cpu_model); - void cpu_openrisc_list(FILE *f, fprintf_function cpu_fprintf); int cpu_openrisc_exec(CPUOpenRISCState *s); void do_interrupt(CPUOpenRISCState *env); @@ -385,7 +383,7 @@ int cpu_openrisc_get_phys_data(OpenRISCCPU *cpu, int *prot, target_ulong address, int rw); #endif -#define cpu_init(m) CPU(cpu_openrisc_init(m)) +#define cpu_init(m) generic_cpu_init(TYPE_OPENRISC_CPU, m) #if defined(CONFIG_USER_ONLY) static inline void cpu_clone_regs(CPUOpenRISCState *env, target_ulong newsp) -- 1.7.11.7