@@ -52,7 +52,7 @@ typedef struct S390CPUClass {
bool is_migration_safe;
const char *desc;
- int64_t next_cpu_id;
+ uint32_t next_cpu_addr;
DeviceRealize parent_realize;
void (*parent_reset)(CPUState *cpu);
@@ -201,10 +201,10 @@ static void s390_cpu_realizefn(DeviceState *dev, Error **errp)
cpu->env.cpu_addr);
goto out;
}
- if (cpu->env.cpu_addr != scc->next_cpu_id) {
+ if (cpu->env.cpu_addr != scc->next_cpu_addr) {
error_setg(&err, "Unable to add CPU: %" PRIu32
- ", the next available nr is %" PRIi64, cpu->env.cpu_addr,
- scc->next_cpu_id);
+ ", the next available addr is %" PRIu32, cpu->env.cpu_addr,
+ scc->next_cpu_addr);
goto out;
}
@@ -214,7 +214,7 @@ static void s390_cpu_realizefn(DeviceState *dev, Error **errp)
if (err != NULL) {
goto out;
}
- scc->next_cpu_id++;
+ scc->next_cpu_addr++;
#if !defined(CONFIG_USER_ONLY)
qemu_register_reset(s390_cpu_machine_reset_cb, cpu);
@@ -459,7 +459,6 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
CPUClass *cc = CPU_CLASS(scc);
DeviceClass *dc = DEVICE_CLASS(oc);
- scc->next_cpu_id = 0;
scc->parent_realize = dc->realize;
dc->realize = s390_cpu_realizefn;
dc->props = s390x_cpu_properties;
@@ -134,9 +134,9 @@ S390CPU *cpu_s390x_init(const char *cpu_model)
Error *err = NULL;
S390CPU *cpu;
/* Use to track CPU ID for linux-user only */
- static int64_t next_cpu_id;
+ static uint32_t next_cpu_addr;
- cpu = s390x_new_cpu(cpu_model, next_cpu_id++, &err);
+ cpu = s390x_new_cpu(cpu_model, next_cpu_addr++, &err);
if (err) {
error_report_err(err);
}
Adapt the term address/adddr. While at it, fix the type and drop the initialization to 0 (which is superfluous). Signed-off-by: David Hildenbrand <david@redhat.com> --- target/s390x/cpu-qom.h | 2 +- target/s390x/cpu.c | 9 ++++----- target/s390x/helper.c | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-)