[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 36/46] s390x: move s390x_new_cpu() into board code
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 36/46] s390x: move s390x_new_cpu() into board code |
Date: |
Fri, 20 Oct 2017 13:54:08 +0200 |
From: Igor Mammedov <address@hidden>
s390-virtio-ccw.c is the sole user of s390x_new_cpu(),
so move this helper there.
Signed-off-by: Igor Mammedov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/s390x/s390-virtio-ccw.c | 21 +++++++++++++++++++++
target/s390x/cpu.h | 1 -
target/s390x/helper.c | 20 --------------------
3 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index e4474587aa..baeafdcb1c 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -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);
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index b684502900..4db8b5409e 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -702,7 +702,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)
diff --git a/target/s390x/helper.c b/target/s390x/helper.c
index 9ff7ff4acc..f78983dd6a 100644
--- a/target/s390x/helper.c
+++ b/target/s390x/helper.c
@@ -61,26 +61,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)
--
2.13.6
- [Qemu-devel] [PULL 26/46] s390x/tcg: flush the tlb on SIGP SET PREFIX, (continued)
- [Qemu-devel] [PULL 26/46] s390x/tcg: flush the tlb on SIGP SET PREFIX, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 27/46] s390x/tcg: switch to new SIGP handling code, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 28/46] s390x/cpumodel: allow to enable SENSE RUNNING STATUS for qemu, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 29/46] s390x/tcg: unlock NMI, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 30/46] s390x/tcg: refactor stfl(e) to use s390_get_feat_block(), Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 31/46] target/s390x: special handling when starting a CPU with WAIT PSW, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 32/46] virtio-ccw: Add the virtio-input devices for CCW bus, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 34/46] s390x/event-facility: variable-length event masks, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 35/46] s390x: fix cpu object referrence leak in s390x_new_cpu(), Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 33/46] s390x/MAINTAINERS: add mailing list, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 36/46] s390x: move s390x_new_cpu() into board code,
Cornelia Huck <=
- [Qemu-devel] [PULL 37/46] s390x/css: IO instr handler ending control, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 38/46] s390x: improve error handling for SSCH and RSCH, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 39/46] s390x: refactor error handling for XSCH handler, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 40/46] s390x: refactor error handling for CSCH handler, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 41/46] s390x: refactor error handling for HSCH handler, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 42/46] s390x: refactor error handling for MSCH handler, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 43/46] libqtest: Add qtest_[v]startf(), Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 44/46] tests: Enable the very simple virtio tests on s390x, too, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 45/46] accel/tcg: allow to invalidate a write TLB entry immediately, Cornelia Huck, 2017/10/20
- [Qemu-devel] [PULL 46/46] s390x/tcg: low-address protection support, Cornelia Huck, 2017/10/20