aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2023-04-24 18:04:32 +0200
committerThomas Huth <thuth@redhat.com>2023-05-16 09:14:18 +0200
commit5503da4a0c9e7f6853a175f5e273897680cd12df (patch)
tree752e566cb853a89bd25ec77b4abf8fe6a5f3cf8b /target
parentc70bb9a771d467302d1c7df5c5bd56b48f42716e (diff)
downloadqemu-5503da4a0c9e7f6853a175f5e273897680cd12df.zip
qemu-5503da4a0c9e7f6853a175f5e273897680cd12df.tar.gz
qemu-5503da4a0c9e7f6853a175f5e273897680cd12df.tar.bz2
hw/core: Use a callback for target specific query-cpus-fast information
For being able to create a universal QEMU binary one day, core files like machine-qmp-cmds.c must not contain any "#ifdef TARGET_..." parts. Thus let's provide the target specific function via a function pointer in CPUClass instead, as a first step towards making this file target independent. Message-Id: <20230424160434.331175-2-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'target')
-rw-r--r--target/s390x/cpu.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index 40fdeaa..df16749 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -140,6 +140,13 @@ static bool s390_cpu_has_work(CPUState *cs)
return s390_cpu_has_int(cpu);
}
+static void s390_query_cpu_fast(CPUState *cpu, CpuInfoFast *value)
+{
+ S390CPU *s390_cpu = S390_CPU(cpu);
+
+ value->u.s390x.cpu_state = s390_cpu->env.cpu_state;
+}
+
/* S390CPUClass::reset() */
static void s390_cpu_reset(CPUState *s, cpu_reset_type type)
{
@@ -332,6 +339,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
cc->class_by_name = s390_cpu_class_by_name,
cc->has_work = s390_cpu_has_work;
cc->dump_state = s390_cpu_dump_state;
+ cc->query_cpu_fast = s390_query_cpu_fast;
cc->set_pc = s390_cpu_set_pc;
cc->get_pc = s390_cpu_get_pc;
cc->gdb_read_register = s390_cpu_gdb_read_register;