@@ -695,7 +695,6 @@ void s390_cpu_list(FILE *f, fprintf_function cpu_fprintf);
/* helper.c */
#define cpu_init(cpu_model) cpu_generic_init(TYPE_S390_CPU, cpu_model)
-S390CPU *s390x_new_cpu(const char *typename, uint32_t core_id, Error **errp);
#define S390_CPU_TYPE_SUFFIX "-" TYPE_S390_CPU
#define S390_CPU_TYPE_NAME(name) (name S390_CPU_TYPE_SUFFIX)
@@ -52,6 +52,27 @@ S390CPU *s390_cpu_addr2state(uint16_t cpu_addr)
return S390_CPU(ms->possible_cpus->cpus[cpu_addr].cpu);
}
+static S390CPU *s390x_new_cpu(const char *typename, uint32_t core_id,
+ Error **errp)
+{
+ S390CPU *cpu = S390_CPU(object_new(typename));
+ Error *err = NULL;
+
+ object_property_set_int(OBJECT(cpu), core_id, "core-id", &err);
+ if (err != NULL) {
+ goto out;
+ }
+ object_property_set_bool(OBJECT(cpu), true, "realized", &err);
+
+out:
+ object_unref(OBJECT(cpu));
+ if (err) {
+ error_propagate(errp, err);
+ cpu = NULL;
+ }
+ return cpu;
+}
+
static void s390_init_cpus(MachineState *machine)
{
MachineClass *mc = MACHINE_GET_CLASS(machine);
@@ -68,26 +68,6 @@ void s390x_cpu_timer(void *opaque)
}
#endif
-S390CPU *s390x_new_cpu(const char *typename, uint32_t core_id, Error **errp)
-{
- S390CPU *cpu = S390_CPU(object_new(typename));
- Error *err = NULL;
-
- object_property_set_int(OBJECT(cpu), core_id, "core-id", &err);
- if (err != NULL) {
- goto out;
- }
- object_property_set_bool(OBJECT(cpu), true, "realized", &err);
-
-out:
- object_unref(OBJECT(cpu));
- if (err) {
- error_propagate(errp, err);
- cpu = NULL;
- }
- return cpu;
-}
-
#ifndef CONFIG_USER_ONLY
hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr)
s390-virtio-ccw.c is the sole user of s390x_new_cpu(), so move this helper there. Signed-off-by: Igor Mammedov <imammedo@redhat.com> --- CC: Cornelia Huck <cohuck@redhat.com> v2: - style fix: wrap the argument list --- target/s390x/cpu.h | 1 - hw/s390x/s390-virtio-ccw.c | 21 +++++++++++++++++++++ target/s390x/helper.c | 20 -------------------- 3 files changed, 21 insertions(+), 21 deletions(-)