@@ -821,7 +821,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
CPUState *cs;
qemu_irq *input;
- cpu = cpu_ppc_init(machine->cpu_model);
+ cpu = ppc_cpu_init(machine->cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to initialize CPU!\n");
exit(1);
@@ -193,7 +193,7 @@ static void ppc_core99_init(MachineState *machine)
#endif
}
for (i = 0; i < smp_cpus; i++) {
- cpu = cpu_ppc_init(machine->cpu_model);
+ cpu = ppc_cpu_init(machine->cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to find PowerPC CPU definition\n");
exit(1);
@@ -113,7 +113,7 @@ static void ppc_heathrow_init(MachineState *machine)
if (machine->cpu_model == NULL)
machine->cpu_model = "G3";
for (i = 0; i < smp_cpus; i++) {
- cpu = cpu_ppc_init(machine->cpu_model);
+ cpu = ppc_cpu_init(machine->cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to find PowerPC CPU definition\n");
exit(1);
@@ -1350,3 +1350,8 @@ PowerPCCPU *ppc_get_vcpu_by_dt_id(int cpu_dt_id)
return NULL;
}
+
+PowerPCCPU *ppc_cpu_init(const char *cpu_model)
+{
+ return POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, cpu_model));
+}
@@ -186,7 +186,7 @@ static void bamboo_init(MachineState *machine)
if (machine->cpu_model == NULL) {
machine->cpu_model = "440EP";
}
- cpu = cpu_ppc_init(machine->cpu_model);
+ cpu = ppc_cpu_init(machine->cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to initialize CPU!\n");
exit(1);
@@ -56,7 +56,7 @@ PowerPCCPU *ppc4xx_init(const char *cpu_model,
CPUPPCState *env;
/* init CPUs */
- cpu = cpu_ppc_init(cpu_model);
+ cpu = ppc_cpu_init(cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to find PowerPC %s CPU definition\n",
cpu_model);
@@ -509,7 +509,7 @@ static void ppc_prep_init(MachineState *machine)
if (machine->cpu_model == NULL)
machine->cpu_model = "602";
for (i = 0; i < smp_cpus; i++) {
- cpu = cpu_ppc_init(machine->cpu_model);
+ cpu = ppc_cpu_init(machine->cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to find PowerPC CPU definition\n");
exit(1);
@@ -1835,7 +1835,7 @@ static void ppc_spapr_init(MachineState *machine)
g_free(type);
} else {
for (i = 0; i < smp_cpus; i++) {
- PowerPCCPU *cpu = cpu_ppc_init(machine->cpu_model);
+ PowerPCCPU *cpu = ppc_cpu_init(machine->cpu_model);
if (cpu == NULL) {
error_report("Unable to find PowerPC CPU definition");
exit(1);
@@ -96,7 +96,7 @@ static PowerPCCPU *ppc440_init_xilinx(ram_addr_t *ram_size,
CPUPPCState *env;
qemu_irq *irqs;
- cpu = cpu_ppc_init(cpu_model);
+ cpu = ppc_cpu_init(cpu_model);
if (cpu == NULL) {
fprintf(stderr, "Unable to initialize CPU!\n");
exit(1);
@@ -106,4 +106,5 @@ enum {
/* ppc_booke.c */
void ppc_booke_timers_init(PowerPCCPU *cpu, uint32_t freq, uint32_t flags);
+PowerPCCPU *ppc_cpu_init(const char *cpu_model);
#endif
@@ -1198,7 +1198,6 @@ extern const struct VMStateDescription vmstate_ppc_cpu;
#endif
/*****************************************************************************/
-PowerPCCPU *cpu_ppc_init(const char *cpu_model);
void ppc_translate_init(void);
void gen_update_current_nip(void *opaque);
/* you can call this signal handler from your SIGBUS and SIGSEGV
@@ -1277,7 +1276,9 @@ static inline uint64_t ppc_dump_gpr(CPUPPCState *env, int gprn)
int ppc_dcr_read (ppc_dcr_t *dcr_env, int dcrn, uint32_t *valp);
int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, uint32_t val);
-#define cpu_init(cpu_model) CPU(cpu_ppc_init(cpu_model))
+#if defined(CONFIG_USER_ONLY)
+#define cpu_init(cpu_model) cpu_generic_init(TYPE_POWERPC_CPU, cpu_model)
+#endif
#define cpu_signal_handler cpu_ppc_signal_handler
#define cpu_list ppc_cpu_list
@@ -10012,11 +10012,6 @@ static ObjectClass *ppc_cpu_class_by_name(const char *name)
return NULL;
}
-PowerPCCPU *cpu_ppc_init(const char *cpu_model)
-{
- return POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, cpu_model));
-}
-
/* Sort by PVR, ordering special case "host" last. */
static gint ppc_cpu_list_compare(gconstpointer a, gconstpointer b)
{