@@ -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);
@@ -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;
@@ -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)
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- hw/openrisc_sim.c | 2 +- target-openrisc/cpu.c | 22 ---------------------- target-openrisc/cpu.h | 4 +--- 3 files changed, 2 insertions(+), 26 deletions(-)