[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/28] cpus: Introduce SysemuCPUOps::has_work() handler
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 07/28] cpus: Introduce SysemuCPUOps::has_work() handler |
Date: |
Tue, 21 Jan 2025 15:23:20 +0100 |
SysemuCPUOps::has_work() is similar to CPUClass::has_work(),
but only exposed on system emulation.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/core/sysemu-cpu-ops.h | 4 ++++
hw/core/cpu-system.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-ops.h
index 0df5b058f50..dee8a62ca98 100644
--- a/include/hw/core/sysemu-cpu-ops.h
+++ b/include/hw/core/sysemu-cpu-ops.h
@@ -16,6 +16,10 @@
* struct SysemuCPUOps: System operations specific to a CPU class
*/
typedef struct SysemuCPUOps {
+ /**
+ * @has_work: Callback for checking if there is work to do.
+ */
+ bool (*has_work)(CPUState *cpu);
/**
* @get_memory_mapping: Callback for obtaining the memory mappings.
*/
diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c
index 16d5efee12d..7b16bda2250 100644
--- a/hw/core/cpu-system.c
+++ b/hw/core/cpu-system.c
@@ -25,6 +25,10 @@
bool cpu_has_work(CPUState *cpu)
{
+ if (cpu->cc->sysemu_ops->has_work) {
+ return cpu->cc->sysemu_ops->has_work(cpu);
+ }
+
g_assert(cpu->cc->has_work);
return cpu->cc->has_work(cpu);
}
--
2.47.1
- [PATCH 02/28] target/rx: Ensure not being build on user emulation, (continued)
- [PATCH 02/28] target/rx: Ensure not being build on user emulation, Philippe Mathieu-Daudé, 2025/01/21
- [PATCH 03/28] target/tricore: Ensure not being build on user emulation, Philippe Mathieu-Daudé, 2025/01/21
- [PATCH 04/28] cpus: Restrict cpu_get_memory_mapping() to system emulation, Philippe Mathieu-Daudé, 2025/01/21
- [PATCH 05/28] cpus: Restrict cpu_has_work() to system emulation, Philippe Mathieu-Daudé, 2025/01/21
- [PATCH 06/28] cpus: Un-inline cpu_has_work(), Philippe Mathieu-Daudé, 2025/01/21
- [PATCH 07/28] cpus: Introduce SysemuCPUOps::has_work() handler,
Philippe Mathieu-Daudé <=
- [PATCH 08/28] target/alpha: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/21
- [PATCH 09/28] target/arm: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/21
- [PATCH 10/28] target/avr: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/21
- [PATCH 11/28] target/hexagon: Remove CPUClass:has_work() handler, Philippe Mathieu-Daudé, 2025/01/21