[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/35] sysemu: Introduce AccelOpsClass::has_work()
From: |
Richard Henderson |
Subject: |
[PULL 05/35] sysemu: Introduce AccelOpsClass::has_work() |
Date: |
Thu, 16 Sep 2021 08:29:55 -0700 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Introduce an accelerator-specific has_work() handler.
Eventually call it from cpu_has_work().
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210912172731.789788-5-f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/sysemu/accel-ops.h | 5 +++++
softmmu/cpus.c | 3 +++
2 files changed, 8 insertions(+)
diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h
index 032f6979d7..de83f095f2 100644
--- a/include/sysemu/accel-ops.h
+++ b/include/sysemu/accel-ops.h
@@ -31,6 +31,11 @@ struct AccelOpsClass {
void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY NON-NULL */
void (*kick_vcpu_thread)(CPUState *cpu);
+ /**
+ * @has_work: Callback for checking if there is work to do.
+ */
+ bool (*has_work)(CPUState *cpu);
+
void (*synchronize_post_reset)(CPUState *cpu);
void (*synchronize_post_init)(CPUState *cpu);
void (*synchronize_state)(CPUState *cpu);
diff --git a/softmmu/cpus.c b/softmmu/cpus.c
index 7e2cb2c571..2a61dfd628 100644
--- a/softmmu/cpus.c
+++ b/softmmu/cpus.c
@@ -255,6 +255,9 @@ bool cpu_has_work(CPUState *cpu)
{
CPUClass *cc = CPU_GET_CLASS(cpu);
+ if (cpus_accel->has_work) {
+ return cpus_accel->has_work(cpu);
+ }
g_assert(cc->has_work);
return cc->has_work(cpu);
}
--
2.25.1
- [PULL 00/35] tcg patch queue, Richard Henderson, 2021/09/16
- [PULL 06/35] accel/kvm: Implement AccelOpsClass::has_work(), Richard Henderson, 2021/09/16
- [PULL 03/35] hw/core: Restrict cpu_has_work() to sysemu, Richard Henderson, 2021/09/16
- [PULL 08/35] accel/tcg: Implement AccelOpsClass::has_work() as stub, Richard Henderson, 2021/09/16
- [PULL 04/35] hw/core: Un-inline cpu_has_work(), Richard Henderson, 2021/09/16
- [PULL 07/35] accel/whpx: Implement AccelOpsClass::has_work(), Richard Henderson, 2021/09/16
- [PULL 05/35] sysemu: Introduce AccelOpsClass::has_work(),
Richard Henderson <=
- [PULL 02/35] accel/tcg: Restrict cpu_handle_halt() to sysemu, Richard Henderson, 2021/09/16
- [PULL 01/35] include/exec: Move cpu_signal_handler declaration, Richard Henderson, 2021/09/16
- [PULL 13/35] target/hexagon: Remove unused has_work() handler, Richard Henderson, 2021/09/16
- [PULL 11/35] target/avr: Restrict has_work() handler to sysemu, Richard Henderson, 2021/09/16
- [PULL 12/35] target/cris: Restrict has_work() handler to sysemu, Richard Henderson, 2021/09/16
- [PULL 09/35] target/alpha: Restrict has_work() handler to sysemu, Richard Henderson, 2021/09/16
- [PULL 10/35] target/arm: Restrict has_work() handler to sysemu and TCG, Richard Henderson, 2021/09/16
- [PULL 14/35] target/hppa: Restrict has_work() handler to sysemu, Richard Henderson, 2021/09/16
- [PULL 19/35] target/nios2: Restrict has_work() handler to sysemu, Richard Henderson, 2021/09/16
- [PULL 22/35] target/ppc: Restrict has_work() handlers to sysemu and TCG, Richard Henderson, 2021/09/16