diff options
| author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-01-26 08:17:59 +0100 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-03-09 17:00:47 +0100 |
| commit | d0a4ccae953b7482a682b9b9f8619804059ecc89 (patch) | |
| tree | ab0245ac09ee186750de5b22f15c4cc519b8de02 /hw/core/cpu-system.c | |
| parent | f37799c6c1d2e8fb43f5e1f100f26c5401d9b3ff (diff) | |
| download | focaccia-qemu-d0a4ccae953b7482a682b9b9f8619804059ecc89.tar.gz focaccia-qemu-d0a4ccae953b7482a682b9b9f8619804059ecc89.zip | |
cpus: Remove CPUClass::has_work() handler
All handlers have been converted to SysemuCPUOps::has_work(). Remove CPUClass::has_work along with cpu_common_has_work() and simplify cpu_has_work(), making SysemuCPUOps::has_work handler mandatory. Note, since cpu-common.c is in meson's common_ss[] source set, we must define cpu_exec_class_post_init() in cpu-target.c (which is in the specific_ss[] source set) to have CONFIG_USER_ONLY defined. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20250125170125.32855-25-philmd@linaro.org>
Diffstat (limited to 'hw/core/cpu-system.c')
| -rw-r--r-- | hw/core/cpu-system.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 601335fd76..aed5076ec7 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -33,12 +33,7 @@ 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); + return cpu->cc->sysemu_ops->has_work(cpu); } bool cpu_paging_enabled(const CPUState *cpu) @@ -188,6 +183,12 @@ void cpu_class_init_props(DeviceClass *dc) device_class_set_props(dc, cpu_system_props); } +void cpu_exec_class_post_init(CPUClass *cc) +{ + /* Check mandatory SysemuCPUOps handlers */ + g_assert(cc->sysemu_ops->has_work); +} + void cpu_exec_initfn(CPUState *cpu) { cpu->memory = get_system_memory(); |