[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 16/24] target/riscv: Move has_work() from CPUClass to SysemuCP
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 16/24] target/riscv: Move has_work() from CPUClass to SysemuCPUOps |
Date: |
Sat, 25 Jan 2025 17:05:44 +0100 |
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
Cc: qemu-riscv@nongnu.org
---
target/riscv/internals.h | 4 +++-
target/riscv/cpu.c | 8 +++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/target/riscv/internals.h b/target/riscv/internals.h
index 67291933f84..213aff31d85 100644
--- a/target/riscv/internals.h
+++ b/target/riscv/internals.h
@@ -142,8 +142,10 @@ static inline float16 check_nanbox_h(CPURISCVState *env,
uint64_t f)
}
}
-/* Our implementation of CPUClass::has_work */
+#ifndef CONFIG_USER_ONLY
+/* Our implementation of SysemuCPUOps::has_work */
bool riscv_cpu_has_work(CPUState *cs);
+#endif
/* Zjpm addr masking routine */
static inline target_ulong adjust_addr_body(CPURISCVState *env,
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 3d4bd157d2c..4a7e02d9a99 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -1010,9 +1010,9 @@ static vaddr riscv_cpu_get_pc(CPUState *cs)
return env->pc;
}
+#ifndef CONFIG_USER_ONLY
bool riscv_cpu_has_work(CPUState *cs)
{
-#ifndef CONFIG_USER_ONLY
RISCVCPU *cpu = RISCV_CPU(cs);
CPURISCVState *env = &cpu->env;
/*
@@ -1022,10 +1022,8 @@ bool riscv_cpu_has_work(CPUState *cs)
return riscv_cpu_all_pending(env) != 0 ||
riscv_cpu_sirq_pending(env) != RISCV_EXCP_NONE ||
riscv_cpu_vsirq_pending(env) != RISCV_EXCP_NONE;
-#else
- return true;
-#endif
}
+#endif /* !CONFIG_USER_ONLY */
static int riscv_cpu_mmu_index(CPUState *cs, bool ifetch)
{
@@ -2912,6 +2910,7 @@ static int64_t riscv_get_arch_id(CPUState *cs)
#include "hw/core/sysemu-cpu-ops.h"
static const struct SysemuCPUOps riscv_sysemu_ops = {
+ .has_work = riscv_cpu_has_work,
.get_phys_page_debug = riscv_cpu_get_phys_page_debug,
.write_elf64_note = riscv_cpu_write_elf64_note,
.write_elf32_note = riscv_cpu_write_elf32_note,
@@ -2933,7 +2932,6 @@ static void riscv_cpu_common_class_init(ObjectClass *c,
void *data)
&mcc->parent_phases);
cc->class_by_name = riscv_cpu_class_by_name;
- cc->has_work = riscv_cpu_has_work;
cc->mmu_index = riscv_cpu_mmu_index;
cc->dump_state = riscv_cpu_dump_state;
cc->set_pc = riscv_cpu_set_pc;
--
2.47.1
- [PATCH v2 03/24] cpus: Introduce SysemuCPUOps::has_work() handler, (continued)
- [PATCH v2 03/24] cpus: Introduce SysemuCPUOps::has_work() handler, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 04/24] target/alpha: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 05/24] target/arm: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 06/24] target/avr: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 07/24] target/hexagon: Remove CPUClass:has_work() handler, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 08/24] target/hppa: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 09/24] target/i386: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 10/24] target/loongarch: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 11/24] target/m68k: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 12/24] target/microblaze: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 16/24] target/riscv: Move has_work() from CPUClass to SysemuCPUOps,
Philippe Mathieu-Daudé <=
- [PATCH v2 22/24] target/tricore: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 20/24] target/sh4: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 15/24] target/ppc: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 24/24] cpus: Remove CPUClass::has_work() handler, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 18/24] target/s390x: Restrict I/O handler installers to system emulation, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 13/24] target/mips: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 14/24] target/openrisc: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25
- [PATCH v2 21/24] target/sparc: Move has_work() from CPUClass to SysemuCPUOps, Philippe Mathieu-Daudé, 2025/01/25